MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / test_cert_ssl_implicitly_set

Method test_cert_ssl_implicitly_set

test/test_ssl.py:206–230  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

204 @client_context.require_no_auth
205 @ignore_deprecations
206 def test_cert_ssl_implicitly_set(self):
207 # Expects the server to be running with server.pem and ca.pem
208 #
209 # --sslPEMKeyFile=/path/to/pymongo/test/certificates/server.pem
210 # --sslCAFile=/path/to/pymongo/test/certificates/ca.pem
211 #
212
213 # test that setting tlsCertificateKeyFile causes ssl to be set to True
214 client = self.simple_client(
215 client_context.host,
216 client_context.port,
217 tlsAllowInvalidCertificates=True,
218 tlsCertificateKeyFile=CLIENT_PEM,
219 )
220 response = client.admin.command(HelloCompat.LEGACY_CMD)
221 if "setName" in response:
222 client = self.simple_client(
223 client_context.pair,
224 replicaSet=response["setName"],
225 w=len(response["hosts"]),
226 tlsAllowInvalidCertificates=True,
227 tlsCertificateKeyFile=CLIENT_PEM,
228 )
229
230 self.assertClientWorks(client)
231
232 @client_context.require_tlsCertificateKeyFile
233 @client_context.require_no_auth

Callers

nothing calls this directly

Calls 3

assertClientWorksMethod · 0.95
simple_clientMethod · 0.45
commandMethod · 0.45

Tested by

no test coverage detected