Skip to content

Commit

Permalink
add ssl connection example
Browse files Browse the repository at this point in the history
  • Loading branch information
nakagami committed Jan 29, 2024
1 parent 8da7788 commit 1cb578b
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion README.rst
Expand Up @@ -29,7 +29,7 @@ copy a module file.
Example
-----------------

Query::
::

import minipg
conn = minipg.connect(host='localhost',
Expand All @@ -42,6 +42,25 @@ Query::
print(r[0], r[1])
conn.close()

SSL Connection
++++++++++++++++++

You can make an SSL connection with an instance of SSLContext.
Below is an example of an ssl connection without certificate validation.

::

import ssl
import minipg
ssl_context = ssl.create_default_context()
ssl_context.check_hostname = False
ssl_context.verify_mode = ssl.CERT_NONE
conn = minipg.connect(host='localhost',
user='postgres',
password='secret',
database='database_name',
ssl_context=ssl_context)


Restrictions and Unsupported Features
--------------------------------------
Expand Down

0 comments on commit 1cb578b

Please sign in to comment.