Linux newlinux5.pouyasazan.org 3.10.0-962.3.2.lve1.5.60.el7.x86_64 #1 SMP Fri Jul 23 07:07:00 EDT 2021 x86_64
LiteSpeed
Server IP : 88.99.66.243 & Your IP : 216.73.216.178
Domains :
Cant Read [ /etc/named.conf ]
User : wdbbsgxf
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
lib /
python2.7 /
site-packages /
ndg /
httpsclient /
Delete
Unzip
Name
Size
Permission
Date
Action
test
[ DIR ]
drwxr-xr-x
2022-02-05 00:54
__init__.py
390
B
-rw-r--r--
2012-01-06 19:47
__init__.pyc
625
B
-rw-r--r--
2014-10-31 13:34
__init__.pyo
625
B
-rw-r--r--
2014-10-31 13:34
https.py
4.49
KB
-rw-r--r--
2012-07-10 11:41
https.pyc
4.72
KB
-rw-r--r--
2014-10-31 13:34
https.pyo
4.72
KB
-rw-r--r--
2014-10-31 13:34
ssl_context_util.py
2.95
KB
-rw-r--r--
2012-03-07 01:32
ssl_context_util.pyc
3.4
KB
-rw-r--r--
2014-10-31 13:34
ssl_context_util.pyo
3.4
KB
-rw-r--r--
2014-10-31 13:34
ssl_peer_verification.py
9.11
KB
-rw-r--r--
2012-10-23 22:08
ssl_peer_verification.pyc
8.46
KB
-rw-r--r--
2014-10-31 13:34
ssl_peer_verification.pyo
8.46
KB
-rw-r--r--
2014-10-31 13:34
ssl_socket.py
9.56
KB
-rw-r--r--
2012-08-20 15:07
ssl_socket.pyc
12
KB
-rw-r--r--
2014-10-31 13:34
ssl_socket.pyo
12
KB
-rw-r--r--
2014-10-31 13:34
subj_alt_name.py
5.64
KB
-rw-r--r--
2012-02-08 20:36
subj_alt_name.pyc
6.23
KB
-rw-r--r--
2014-10-31 13:34
subj_alt_name.pyo
6.23
KB
-rw-r--r--
2014-10-31 13:34
urllib2_build_opener.py
2.16
KB
-rw-r--r--
2012-05-28 18:11
urllib2_build_opener.pyc
2.37
KB
-rw-r--r--
2014-10-31 13:34
urllib2_build_opener.pyo
2.37
KB
-rw-r--r--
2014-10-31 13:34
utils.py
14.04
KB
-rw-r--r--
2012-10-16 14:13
utils.pyc
11.98
KB
-rw-r--r--
2014-10-31 13:34
utils.pyo
11.98
KB
-rw-r--r--
2014-10-31 13:34
Save
Rename
"""ndg_httpsclient SSL Context utilities module containing convenience routines for setting SSL context configuration. """ __author__ = "P J Kershaw (STFC)" __date__ = "09/12/11" __copyright__ = "(C) 2012 Science and Technology Facilities Council" __license__ = "BSD - see LICENSE file in top-level directory" __contact__ = "Philip.Kershaw@stfc.ac.uk" __revision__ = '$Id$' import urlparse from OpenSSL import SSL from ndg.httpsclient.ssl_peer_verification import ServerSSLCertVerification class SSlContextConfig(object): """ Holds configuration options for creating a SSL context. This is used as a template to create the contexts with specific verification callbacks. """ def __init__(self, key_file=None, cert_file=None, pem_file=None, ca_dir=None, verify_peer=False): self.key_file = key_file self.cert_file = cert_file self.pem_file = pem_file self.ca_dir = ca_dir self.verify_peer = verify_peer def make_ssl_context_from_config(ssl_config=False, url=None): return make_ssl_context(ssl_config.key_file, ssl_config.cert_file, ssl_config.pem_file, ssl_config.ca_dir, ssl_config.verify_peer, url) def make_ssl_context(key_file=None, cert_file=None, pem_file=None, ca_dir=None, verify_peer=False, url=None, method=SSL.SSLv23_METHOD): """ Creates SSL context containing certificate and key file locations. """ ssl_context = SSL.Context(method) # Key file defaults to certificate file if present. if cert_file: ssl_context.use_certificate_file(cert_file) if key_file: ssl_context.use_privatekey_file(key_file) else: if cert_file: ssl_context.use_privatekey_file(cert_file) if pem_file or ca_dir: ssl_context.load_verify_locations(pem_file, ca_dir) def _callback(conn, x509, errnum, errdepth, preverify_ok): """Default certification verification callback. Performs no checks and returns the status passed in. """ return preverify_ok verify_callback = _callback if verify_peer: ssl_context.set_verify_depth(9) if url: set_peer_verification_for_url_hostname(ssl_context, url) else: ssl_context.set_verify(SSL.VERIFY_PEER, verify_callback) else: ssl_context.set_verify(SSL.VERIFY_NONE, verify_callback) return ssl_context def set_peer_verification_for_url_hostname(ssl_context, url, if_verify_enabled=False): '''Convenience routine to set peer verification callback based on ServerSSLCertVerification class''' if not if_verify_enabled or (ssl_context.get_verify_mode() & SSL.VERIFY_PEER): urlObj = urlparse.urlparse(url) hostname = urlObj.hostname verify_callback = ServerSSLCertVerification(hostname=hostname) ssl_context.set_verify(SSL.VERIFY_PEER, verify_callback)