Add SSL cipher info.
322849
def _add_ssl_info(self):
        """"""
        if self.scheme == u'https':
            sock = self._get_ssl_sock()
            if hasattr(sock, 'cipher'):
                self.ssl_cert = sock.getpeercert()
            else:
                # using pyopenssl
                cert = sock.connection.get_peer_certificate()
                self.ssl_cert = httputil.x509_to_dict(cert)
            log.debug(LOG_CHECK, "Got SSL certificate %s", self.ssl_cert)
        else:
            self.ssl_cert = None
252654
public void installCBCCiphers(ComponentFactory ciphers) {
		if (testJCECipher("3des-cbc", TripleDesCbc.class)) {
			ciphers.add("3des-cbc", TripleDesCbc.class);
		}

		if (testJCECipher("blowfish-cbc", BlowfishCbc.class)) {
			ciphers.add("blowfish-cbc", BlowfishCbc.class);
		}

		if (testJCECipher("aes128-cbc", AES128Cbc.class)) {
			ciphers.add("aes128-cbc", AES128Cbc.class);
		}

		if (testJCECipher("aes192-cbc", AES192Cbc.class)) {
			ciphers.add("aes192-cbc", AES192Cbc.class);
		}

		if (testJCECipher("aes256-cbc", AES256Cbc.class)) {
			ciphers.add("aes256-cbc", AES256Cbc.class);
		}
	}
185993
public static void configureTls(ServerBuilder sb, Ssl ssl) {
        configureTls(sb, ssl, null, null);
    }
613800
def generate_adhoc_ssl_context():
    """"""
    from OpenSSL import SSL
    cert, pkey = generate_adhoc_ssl_pair()
    ctx = SSL.Context(SSL.SSLv23_METHOD)
    ctx.use_privatekey(pkey)
    ctx.use_certificate(cert)
    return ctx
846289
def _setup(action)
        @cipher ||= OpenSSL::Cipher.new(@options[:cipher]) 
        # Toggles encryption mode
        @cipher.send(action)
        @cipher.padding = @options[:padding]
        @cipher.key = @key.unpack('a2'*32).map{|x| x.hex}.pack('c'*32)
      end
1349390
private void configureTLS(URL url, URLConnection conn) {
        if ("https".equals(url.getProtocol())) {
            try {
                final HttpsURLConnection secCon = (HttpsURLConnection) conn;
                final SSLSocketFactoryEx factory = new SSLSocketFactoryEx(settings);
                secCon.setSSLSocketFactory(factory);
            } catch (NoSuchAlgorithmException ex) {
                LOGGER.debug("Unsupported algorithm in SSLSocketFactoryEx", ex);
            } catch (KeyManagementException ex) {
                LOGGER.debug("Key management exception in SSLSocketFactoryEx", ex);
            }
        }
    }
567109
public SSLEngine addCommonConfigs(SSLEngine engine) {
        if (sslConfig.getCipherSuites() != null && sslConfig.getCipherSuites().length > 0) {
            engine.setEnabledCipherSuites(sslConfig.getCipherSuites());
        }
        if (sslConfig.getEnableProtocols() != null && sslConfig.getEnableProtocols().length > 0) {
            engine.setEnabledProtocols(sslConfig.getEnableProtocols());
        }
        engine.setEnableSessionCreation(sslConfig.isEnableSessionCreation());
        return engine;
    }
370106
public static base_response add(nitro_service client, sslcipher resource) throws Exception {
		sslcipher addresource = new sslcipher();
		addresource.ciphergroupname = resource.ciphergroupname;
		addresource.ciphgrpalias = resource.ciphgrpalias;
		return addresource.add_resource(client);
	}
168977
def cipher(self):
        

        if not self._handshake_done:
            return

        current_cipher = SSL_get_current_cipher(self._ssl.value)
        cipher_name = SSL_CIPHER_get_name(current_cipher)
        cipher_version = SSL_CIPHER_get_version(current_cipher)
        cipher_bits = SSL_CIPHER_get_bits(current_cipher)
        return cipher_name, cipher_version, cipher_bits
1161203
def enable_encryption(self, output_key, input_key):
        """"""
        self._chacha = chacha20.Chacha20Cipher(output_key, input_key)
601255
def fixup_prngs():
    
    s = os.urandom(256 // 8)
    random.seed(s)
    if 'ssl' in sys.modules:
        sys.modules['ssl'].RAND_add(s, 75.0)
400898
private static void setupSsl(Configuration conf) {
    Configuration sslConf = new Configuration(false);
    sslConf.addResource(conf.get("dfs.https.client.keystore.resource",
        "ssl-client.xml"));
    System.setProperty("javax.net.ssl.trustStore", sslConf.get(
        "ssl.client.truststore.location", ""));
    System.setProperty("javax.net.ssl.trustStorePassword", sslConf.get(
        "ssl.client.truststore.password", ""));
    System.setProperty("javax.net.ssl.trustStoreType", sslConf.get(
        "ssl.client.truststore.type", "jks"));
    System.setProperty("javax.net.ssl.keyStore", sslConf.get(
        "ssl.client.keystore.location", ""));
    System.setProperty("javax.net.ssl.keyStorePassword", sslConf.get(
        "ssl.client.keystore.password", ""));
    System.setProperty("javax.net.ssl.keyPassword", sslConf.get(
        "ssl.client.keystore.keypassword", ""));
    System.setProperty("javax.net.ssl.keyStoreType", sslConf.get(
        "ssl.client.keystore.type", "jks"));
  }
754013
def add_ssl(http)
      if host.start_with?('https')
        http.use_ssl = true
        http.verify_mode = OpenSSL::SSL::VERIFY_PEER
      end
      http
    end
1011494
def setup_ssl_context(config) # :nodoc:
      unless config[:SSLCertificate]
        cn = config[:SSLCertName]
        comment = config[:SSLCertComment]
        cert, key = Utils.create_self_signed_cert(1024, cn, comment)
        config[:SSLCertificate] = cert
        config[:SSLPrivateKey] = key
      end
      ctx = OpenSSL::SSL::SSLContext.new
      ctx.set_params
      ctx.ciphers = (CIPHERS - SmartProxyDynflowCore::Settings.instance.ssl_disabled_ciphers).join(':')
      ctx.key = config[:SSLPrivateKey]
      ctx.cert = config[:SSLCertificate]
      ctx.client_ca = config[:SSLClientCA]
      ctx.extra_chain_cert = config[:SSLExtraChainCert]
      ctx.ca_file = config[:SSLCACertificateFile]
      ctx.ca_path = config[:SSLCACertificatePath]
      ctx.cert_store = config[:SSLCertificateStore]
      ctx.tmp_dh_callback = config[:SSLTmpDhCallback]
      ctx.verify_mode = config[:SSLVerifyClient]
      ctx.verify_depth = config[:SSLVerifyDepth]
      ctx.verify_callback = config[:SSLVerifyCallback]
      ctx.timeout = config[:SSLTimeout]
      ctx.options |= config[:SSLOptions] unless config[:SSLOptions].nil?
      ctx
    end
703329
function configure(newSubtle, newWebCrypto, newNodeCrypto) {
    subtle = newSubtle;
    webCrypto = newWebCrypto;
    nodeCrypto = newNodeCrypto;
}
1305760
protected void loadCipherToBit() {
        boolean keySizeFromCipherMap =
                        Boolean.valueOf(WebContainer.getWebContainerProperties().getProperty("com.ibm.ws.webcontainer.keysizefromciphermap", "true")).booleanValue();
        //721610
        if (keySizeFromCipherMap) {
            this.getKeySizefromCipherMap("toLoad"); // this will load the Map with values
        } else {
            Properties cipherToBitProps = new Properties();

            // load the ssl cipher suite bit sizes property file
            try {
                String fileName = System.getProperty("server.root") + File.separator + "properties" + File.separator + "sslbitsizes.properties";

                cipherToBitProps.load(new FileInputStream(fileName));
            } catch (Exception ex) {
                logger.logp(Level.SEVERE, CLASS_NAME, "loadCipherToBit", "failed.to.load.sslbitsizes.properties ", ex); /* 283348.1 */
                com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(ex, CLASS_NAME + ".loadCipherToBit", "825", this);
            }

            // put the properties into a hash map for unsynch. reference
            _cipherToBit.putAll(cipherToBitProps);
        }
    }
775623
def _sanitize_request_params(self, request_params):
        """"""
        if 'verify_ssl' in request_params:
            request_params['verify'] = request_params.pop('verify_ssl')
        return dict((key, val) for key, val in request_params.items()
                    if key in self._VALID_REQUEST_ARGS)