Skip to content

Commit e7ec748

Browse files
Only import the 2 x values required from 'ssl'
1 parent de7f160 commit e7ec748

File tree

1 file changed

+3
-3
lines changed
  • mongodb_consistent_backup/Common

1 file changed

+3
-3
lines changed

mongodb_consistent_backup/Common/DB.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import logging
2-
import ssl
32

43
from bson.codec_options import CodecOptions
54
from inspect import currentframe, getframeinfo
65
from pymongo import DESCENDING, CursorType, MongoClient
76
from pymongo.errors import ConnectionFailure, OperationFailure, ServerSelectionTimeoutError
7+
from ssl import CERT_REQUIRED, CERT_NONE
88
from time import sleep
99

1010
from mongodb_consistent_backup.Errors import DBAuthenticationError, DBConnectionError, DBOperationError, Error
@@ -58,11 +58,11 @@ def client_opts(self):
5858
"ssl_ca_certs": self.ssl_ca_file,
5959
"ssl_crlfile": self.ssl_crl_file,
6060
"ssl_certfile": self.ssl_client_cert_file,
61-
"ssl_cert_reqs": ssl.CERT_REQUIRED,
61+
"ssl_cert_reqs": CERT_REQUIRED,
6262
})
6363
if self.ssl_insecure:
6464
opts.update({
65-
"ssl_cert_reqs": ssl.CERT_NONE
65+
"ssl_cert_reqs": CERT_NONE
6666
})
6767
return opts
6868

0 commit comments

Comments
 (0)