File: __init__.py

package info (click to toggle)
pypy 7.3.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 113,660 kB
  • sloc: python: 1,419,707; ansic: 64,313; cpp: 3,290; sh: 2,763; makefile: 540; xml: 256; asm: 213; lisp: 45; awk: 4
file content (31 lines) | stat: -rw-r--r-- 1,114 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from _cffi_ssl._stdssl import (_PROTOCOL_NAMES, _OPENSSL_API_VERSION,
        _test_decode_cert, _SSLContext)
from _cffi_ssl import _stdssl
from _cffi_ssl._stdssl import *

OP_SINGLE_DH_USE = lib.SSL_OP_SINGLE_DH_USE
OP_SINGLE_ECDH_USE = lib.SSL_OP_SINGLE_ECDH_USE

try: from __pypy__ import builtinify
except ImportError: builtinify = lambda f: f

RAND_add          = builtinify(RAND_add)
RAND_bytes        = builtinify(RAND_bytes)
RAND_pseudo_bytes = builtinify(RAND_pseudo_bytes)
RAND_status       = builtinify(RAND_status)
# RAND_egd is optional and might not be available on e.g. libressl
if hasattr(_stdssl, 'RAND_egd'):
    RAND_egd          = builtinify(RAND_egd)

import sys
if sys.platform == "win32":
    if 'enum_certificates' not in globals():
        def enum_certificates(*args, **kwds):
            import warnings
            warnings.warn("ssl.enum_certificates() is not implemented")
            return []
    if 'enum_crls' not in globals():
        def enum_crls(*args, **kwds):
            import warnings
            warnings.warn("ssl.enum_crls() is not implemented")
            return []