@@ -77,14 +77,14 @@ Basic configuration
7777...................
7878
7979In many cases connecting to MongoDB over TLS/SSL requires nothing more than
80- passing ``ssl =True `` as a keyword argument to
80+ passing ``tls =True `` as a keyword argument to
8181:class: `~pymongo.mongo_client.MongoClient `::
8282
83- >>> client = pymongo.MongoClient('example.com', ssl =True)
83+ >>> client = pymongo.MongoClient('example.com', tls =True)
8484
85- Or passing ``ssl =true `` in the URI::
85+ Or passing ``tls =true `` in the URI::
8686
87- >>> client = pymongo.MongoClient('mongodb://example.com/?ssl =true')
87+ >>> client = pymongo.MongoClient('mongodb://example.com/?tls =true')
8888
8989This configures PyMongo to connect to the server using TLS, verify the server's
9090certificate and verify that the host you are attempting to connect to is listed
@@ -94,17 +94,17 @@ Certificate verification policy
9494...............................
9595
9696By default, PyMongo is configured to require a certificate from the server when
97- TLS is enabled. This is configurable using the `ssl_cert_reqs ` option. To
98- disable this requirement pass ``ssl.CERT_NONE `` as a keyword parameter::
97+ TLS is enabled. This is configurable using the ``tlsAllowInvalidCertificates ``
98+ option. To disable this requirement pass ``tlsAllowInvalidCertificates=True ``
99+ as a keyword parameter::
99100
100- >>> import ssl
101101 >>> client = pymongo.MongoClient('example.com',
102- ... ssl =True,
103- ... ssl_cert_reqs=ssl.CERT_NONE )
102+ ... tls =True,
103+ ... tlsAllowInvalidCertificates=True )
104104
105105Or, in the URI::
106106
107- >>> uri = 'mongodb://example.com/?ssl =true&ssl_cert_reqs=CERT_NONE '
107+ >>> uri = 'mongodb://example.com/?tls =true&tlsAllowInvalidCertificates=true '
108108 >>> client = pymongo.MongoClient(uri)
109109
110110Specifying a CA file
@@ -113,32 +113,32 @@ Specifying a CA file
113113In some cases you may want to configure PyMongo to use a specific set of CA
114114certificates. This is most often the case when you are acting as your own
115115certificate authority rather than using server certificates signed by a well
116- known authority. The `ssl_ca_certs ` option takes a path to a CA file. It can be
116+ known authority. The `` tlsCAFile ` ` option takes a path to a CA file. It can be
117117passed as a keyword argument::
118118
119119 >>> client = pymongo.MongoClient('example.com',
120- ... ssl =True,
121- ... ssl_ca_certs ='/path/to/ca.pem')
120+ ... tls =True,
121+ ... tlsCAFile ='/path/to/ca.pem')
122122
123123Or, in the URI::
124124
125- >>> uri = 'mongodb://example.com/?ssl =true&ssl_ca_certs =/path/to/ca.pem'
125+ >>> uri = 'mongodb://example.com/?tls =true&tlsCAFile =/path/to/ca.pem'
126126 >>> client = pymongo.MongoClient(uri)
127127
128128Specifying a certificate revocation list
129129........................................
130130
131131Python 2.7.9+ (pypy 2.5.1+) and 3.4+ provide support for certificate revocation
132- lists. The `ssl_crlfile ` option takes a path to a CRL file. It can be passed as
133- a keyword argument::
132+ lists. The `` tlsCRLFile `` option takes a path to a CRL file. It can be passed
133+ as a keyword argument::
134134
135135 >>> client = pymongo.MongoClient('example.com',
136- ... ssl =True,
137- ... ssl_crlfile ='/path/to/crl.pem')
136+ ... tls =True,
137+ ... tlsCRLFile ='/path/to/crl.pem')
138138
139139Or, in the URI::
140140
141- >>> uri = 'mongodb://example.com/?ssl =true&ssl_crlfile =/path/to/crl.pem'
141+ >>> uri = 'mongodb://example.com/?tls =true&tlsCRLFile =/path/to/crl.pem'
142142 >>> client = pymongo.MongoClient(uri)
143143
144144.. note :: Certificate revocation lists and :ref:`OCSP` cannot be used together.
@@ -147,28 +147,29 @@ Client certificates
147147...................
148148
149149PyMongo can be configured to present a client certificate using the
150- `ssl_certfile ` option::
150+ `` tlsCertificateKeyFile ` ` option::
151151
152152 >>> client = pymongo.MongoClient('example.com',
153- ... ssl =True,
154- ... ssl_certfile ='/path/to/client.pem')
153+ ... tls =True,
154+ ... tlsCertificateKeyFile ='/path/to/client.pem')
155155
156156If the private key for the client certificate is stored in a separate file use
157- the `ssl_keyfile ` option::
157+ the `` ssl_keyfile ` ` option::
158158
159159 >>> client = pymongo.MongoClient('example.com',
160- ... ssl =True,
161- ... ssl_certfile ='/path/to/client.pem',
160+ ... tls =True,
161+ ... tlsCertificateKeyFile ='/path/to/client.pem',
162162 ... ssl_keyfile='/path/to/key.pem')
163163
164164Python 2.7.9+ (pypy 2.5.1+) and 3.3+ support providing a password or passphrase
165- to decrypt encrypted private keys. Use the `ssl_pem_passphrase ` option::
165+ to decrypt encrypted private keys. Use the ``tlsCertificateKeyFilePassword ``
166+ option::
166167
167168 >>> client = pymongo.MongoClient('example.com',
168- ... ssl =True,
169- ... ssl_certfile ='/path/to/client.pem',
169+ ... tls =True,
170+ ... tlsCertificateKeyFile ='/path/to/client.pem',
170171 ... ssl_keyfile='/path/to/key.pem',
171- ... ssl_pem_passphrase =<passphrase>)
172+ ... tlsCertificateKeyFilePassword =<passphrase>)
172173
173174
174175These options can also be passed as part of the MongoDB URI.
0 commit comments