From 85974eb5986ffd3afa7e8da686b2b74b63e52f06 Mon Sep 17 00:00:00 2001 From: "A. Tammy" Date: Wed, 13 Dec 2023 01:04:51 -0500 Subject: [PATCH] update examples with SOCK_STREAM (#3) --- README.rst | 13 +++++++++---- pyproject.toml | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 3682690..1bdfd7a 100644 --- a/README.rst +++ b/README.rst @@ -24,24 +24,29 @@ Usage logger.setLevel(logging.INFO) # with default system certificate store - handler1 = TLSSysLogHandler(address=('secure-logging.example.com', 6514), secure=True) + handler1 = TLSSysLogHandler(address=('secure-logging.example.com', 6514), + socktype=socket.SOCK_STREAM, + secure=True) logger.addHandler(handler1) # with custom certificates, via cafile/capath/cadata # refer to https://docs.python.org/3/library/ssl.html#ssl.create_default_context handler2 = TLSSysLogHandler(address=('secure-logging.example.com', 6514), - secure=(cafile='/path/to/ca/file')) + socktype=socket.SOCK_STREAM, + secure={cafile='/path/to/ca/file'}) logger.addHandler(handler2) # with custom SSLContext context = ssl.create_default_context(cafile='/path/to/ca/file') handler3 = TLSSysLogHandler(address=('secure-logging.example.com', 6514), - secure=context) + socktype=socket.SOCK_STREAM, + secure=context) logger.addHandler(handler3) # or allow TLS without verification handler4 = TLSSysLogHandler(address=('secure-logging.example.com', 6514), - secure="noverify") + socktype=socket.SOCK_STREAM, + secure="noverify") logger.addHandler(handler4) logger.info('Hello World!') diff --git a/pyproject.toml b/pyproject.toml index 89e6468..e47c006 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "tlssysloghandler" -version = "1.0.1" +version = "1.0.2" description = "SysLogHandler with TLS" readme = "README.rst" license = {file = "LICENSE"}