Lines Matching defs:if
43 be looked at if provided)
44 CERT_OPTIONAL - certificates are not required, but if provided will be
45 validated, and if validation fails, the connection will
48 if validation fails, the connection will also fail
100 import _ssl # if we can't import it, let the error propagate
257 if sys.platform == "win32":
290 if not dn:
295 if not wildcards:
298 if wildcards > 1:
304 if '*' in dn_remainder:
310 if not sep:
316 if dn_leftmost != '*':
323 if not hostname_leftmost or not sep:
343 if _socket.inet_ntoa(addr) == ipname:
381 The function matches IP addresses rather than dNSNames if hostname is a
394 if not cert:
406 if key == 'DNS':
407 if host_ip is None and _dnsname_match(value, hostname):
411 if host_ip is not None and _ipaddress_match(value, host_ip):
414 if not dnsnames:
421 if key == 'commonName':
422 if _dnsname_match(value, hostname):
425 if len(dnsnames) > 1:
451 return DefaultVerifyPaths(cafile if os.path.isfile(cafile) else None,
452 capath if os.path.isdir(capath) else None,
493 if protocol is None:
504 if hostname is None:
546 if len(b) == 0 or len(b) > 255:
554 if server_name_callback is None:
557 if not callable(server_name_callback):
570 if len(b) == 0 or len(b) > 255:
582 if encoding == "x509_asn":
583 if trust is True or purpose.oid in trust:
587 if certs:
592 if not isinstance(purpose, _ASN1Object):
594 if sys.platform == "win32":
599 if hasattr(_SSLContext, 'minimum_version'):
606 if value == TLSVersion.SSLv3:
626 if hasattr(_ssl, 'HOSTFLAG_NEVER_CHECK_SUBJECT'):
634 if value:
677 if inner is not None:
684 if callback is None:
688 if not hasattr(callback, '__call__'):
702 if content_type == _TLSContentType.HEADER:
753 if not isinstance(purpose, _ASN1Object):
759 if purpose == Purpose.SERVER_AUTH:
769 if cafile or capath or cadata:
777 if hasattr(context, 'keylog_filename'):
779 if keylogfile and not sys.flags.ignore_environment:
794 if not isinstance(purpose, _ASN1Object):
800 if purpose == Purpose.SERVER_AUTH:
802 if protocol is None:
805 if protocol is None:
812 if cert_reqs is not None:
814 if check_hostname:
817 if keyfile and not certfile:
819 if certfile or keyfile:
823 if cafile or capath or cadata:
831 if hasattr(context, 'keylog_filename'):
833 if keylogfile and not sys.flags.ignore_environment:
837 # Used by http.client if no context is explicitly passed.
908 """The currently set server hostname (for SNI), or ``None`` if no
918 if buffer is not None:
936 Return None if no certificate was provided, {} if a certificate was
943 if a next protocol was not negotiated or if NPN is not supported by one
953 if a next protocol was not negotiated or if ALPN is not supported by one
964 None if this is not a valid server connection.
969 """Return the current compression algorithm in use, or ``None`` if
987 if the requested `cb_type` is not supported. Return bytes of the data
988 or None if the data is not available (e.g. before the handshake)."""
1022 if sock.getsockopt(SOL_SOCKET, SO_TYPE) != SOCK_STREAM:
1024 if server_side:
1025 if server_hostname:
1028 if session is not None:
1031 if context.check_hostname and not server_hostname:
1052 # See if we are connected
1056 if e.errno != errno.ENOTCONN:
1069 if e.errno not in (errno.ENOTCONN, errno.EINVAL):
1073 if notconn_pre_handshake_data:
1092 if connected:
1099 if do_handshake_on_connect:
1101 if timeout == 0.0:
1123 if self._sslobj is not None:
1129 if self._sslobj is not None:
1135 if self._sslobj is not None:
1143 # raise an exception here if you wish to check for spurious closes
1147 if not self._connected:
1148 # getpeername() will raise ENOTCONN if the socket is really
1150 # _connected being set, e.g. if connect() first returned
1159 if self._sslobj is None:
1162 if buffer is not None:
1167 if x.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs:
1168 if buffer is not None:
1180 if self._sslobj is None:
1203 if self._sslobj is None or not _ssl.HAS_ALPN:
1211 if self._sslobj is None:
1219 if self._sslobj is None:
1227 if self._sslobj is None:
1234 if self._sslobj is not None:
1235 if flags != 0:
1245 if self._sslobj is not None:
1254 # Ensure programs don't send data unencrypted if they try to
1261 if self._sslobj is not None:
1262 if flags != 0:
1276 """Send a file, possibly by using os.sendfile() if this is a
1279 if self._sslobj is not None:
1287 if self._sslobj is not None:
1288 if flags != 0:
1298 if buffer and (nbytes is None):
1302 if self._sslobj is not None:
1303 if flags != 0:
1313 if self._sslobj is not None:
1321 if self._sslobj is not None:
1338 if self._sslobj is not None:
1350 if self._sslobj:
1359 if self._sslobj:
1373 if timeout == 0.0 and block:
1380 if self.server_side:
1384 if self._connected or self._sslobj is not None:
1391 if connect_ex:
1396 if not rc:
1398 if self.do_handshake_on_connect:
1429 if self._sslobj is not None:
1432 if cb_type not in CHANNEL_BINDING_TYPES:
1440 if self._sslobj is not None:
1462 if server_side and not certfile:
1465 if keyfile and not certfile:
1469 if ca_certs:
1471 if certfile:
1473 if ciphers:
1530 if not pem_cert_string.startswith(PEM_HEADER):
1533 if not pem_cert_string.strip().endswith(PEM_FOOTER):
1549 if ca_certs is not None: