Get the default SSLSocketFactory from Security.

@return String
485704
public static String getDefaultSSLSocketFactory() {
        if (defaultSSLSocketFactory == null) {
            defaultSSLSocketFactory = AccessController.doPrivileged(new PrivilegedAction<String>() {
                @Override
                public String run() {
                    return Security.getProperty("ssl.SocketFactory.provider");
                }
            });
        }

        return defaultSSLSocketFactory;
    }
214904
public function getHost() : string
    {
        $host = null;

        if ($this->isUsingTrustedProxy() && $this->headers->has(self::$trustedHeaderNames[RequestHeaders::CLIENT_HOST])) {
            $hosts = explode(',', $this->headers->get(self::$trustedHeaderNames[RequestHeaders::CLIENT_HOST]));
            $host = trim(end($hosts));
        }

        if ($host === null) {
            $host = $this->headers->get('HOST');
        }

        if ($host === null) {
            $host = $this->server->get('SERVER_NAME');
        }

        if ($host === null) {
            // Return an empty string by default so we can do string operations on it later
            $host = $this->server->get('SERVER_ADDR', '');
        }

        // Remove the port number
        $host = strtolower(preg_replace("/:\d+$/", '', trim($host)));

        // Check for forbidden characters
        // Credit: Symfony HTTPFoundation
        if (!empty($host) && !empty(preg_replace("/(?:^\[)?[a-zA-Z0-9-:\]_]+\.?/", '', $host))) {
            throw new InvalidArgumentException("Invalid host \"$host\"");
        }

        return $host;
    }
717511
@Override
    public SSLServerSocketFactory getSSLServerSocketFactory(SSLConfig config) throws SSLException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.entry(tc, "getSSLServerSocketFactory");

        try {
            SSLContext context = getSSLContext(null, config);

            if (context != null) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    Tr.exit(tc, "getSSLServerSocketFactory");
                return context.getServerSocketFactory();
            }
        } catch (Exception e) {
            FFDCFilter.processException(e, getClass().getName(), "getSSLServerSocketFactory", this);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                Tr.exit(tc, "The following exception occurred in getSSLServerSocketFactory().", new Object[] { e });
            if (e instanceof SSLException)
                throw (SSLException) e;
            throw new SSLException(e);
        }

        throw new SSLException("SSLContext could not be created to return an SSLServerSocketFactory.");
    }
1268730
public function getIpV4() : ?string 
    {
        if ( ! $this->hasIpV4()) {
            $this->setIpV4($this->getDefaultIpV4());
        }
        return $this->ipV4;
    }
749359
private static SslProvider defaultSslProvider() {
    if (OpenSsl.isAvailable()) {
      logger.log(Level.FINE, "Selecting OPENSSL");
      return SslProvider.OPENSSL;
    }
    Provider provider = findJdkProvider();
    if (provider != null) {
      logger.log(Level.FINE, "Selecting JDK with provider {0}", provider);
      return SslProvider.JDK;
    }
    logger.log(Level.INFO, "netty-tcnative unavailable (this may be normal)",
        OpenSsl.unavailabilityCause());
    logger.log(Level.INFO, "Conscrypt not found (this may be normal)");
    logger.log(Level.INFO, "Jetty ALPN unavailable (this may be normal)",
        JettyTlsUtil.getJettyAlpnUnavailabilityCause());
    throw new IllegalStateException(
        "Could not find TLS ALPN provider; "
        + "no working netty-tcnative, Conscrypt, or Jetty NPN/ALPN available");
  }
1111098
private SSLSocketFactory getSocketFactory(String id) throws IOException {
        // first use?
        SSLSocketFactory socketFactory = socketFactoryMap.get(id);
        if (socketFactory == null) {
            // the SSLConfig is optional, so if it's not there, use the default SSLSocketFactory.
            if (id == null) {
                socketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
            } else {
                // ask the SSLConfig bean to create a factory for us.
                try {
                    socketFactory = sslConfig.createSSLFactory(id);
                } catch (Exception e) {
                    Tr.error(tc, "Unable to create client SSL socket factory", e);
                    throw (IOException) new IOException("Unable to create client SSL socket factory: " + e.getMessage()).initCause(e);
                }
            }
            socketFactoryMap.put(id, socketFactory);
        }
        return socketFactory;
    }
1373574
protected static function getDefaultService()
    {
        $service = (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
        $parts = parse_url($service);

        if (isset($parts['query'])) {
            parse_str($parts['query'], $query);
        } else {
            $query = array();
        }
        unset($query['ticket']);
        $parts['query'] = http_build_query($query);

        return self::build_url($parts);
    }
1083418
protected function _getVirtualizationSystem()
    {
        $sSystemType = '';

        if ($this->isExecAllowed()) {
            //VMWare
            @$sDeviceList = $this->_getDeviceList('vmware');
            if ($sDeviceList) {
                $sSystemType = 'VMWare';
                unset($sDeviceList);
            }

            //VirtualBox
            @$sDeviceList = $this->_getDeviceList('VirtualBox');
            if ($sDeviceList) {
                $sSystemType = 'VirtualBox';
                unset($sDeviceList);
            }
        }

        return $sSystemType;
    }
772850
protected SSLServerSocketFactory createFactory() 
    	throws Exception
    {
        SSLContext context;
        if (_provider == null) {
			context = SSLContext.getInstance(_protocol);
		} else {
			context = SSLContext.getInstance(_protocol, _provider);
		}

        KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(_algorithm);        
        KeyStore keyStore = KeyStore.getInstance(_keystoreType);
        keyStore.load(Resource.newResource(_keystore).getInputStream(), _password.toString().toCharArray());
        keyManagerFactory.init(keyStore,_keypassword.toString().toCharArray());
        
        context.init(keyManagerFactory.getKeyManagers(), null, new java.security.SecureRandom());

        return context.getServerSocketFactory();
    }
660566
public static function getDefault()
    {
        /** @var $factory Factory */
        $factory    = new static();
        $factory->addFactory(new CommitFactory(), 100)
                ->addFactory(new HeadFileFactory(), 80)
                ->addFactory(new DefaultFactory(), -100);
        return $factory;
    }
1328064
public static function getHostUri()
  {
    $sheme = (self::getHostParam("HTTPS") == "on") ? "https" : "http";

    $serverName = new Str(self::getHostParam("HTTP_HOST"));
    $serverPort = self::getHostParam("SERVER_PORT");
    $serverPort = ($serverPort != 80 && $serverPort != 443) ? ":" . $serverPort : "";

    if($serverName->endsWith($serverPort))
    {
      $serverName = $serverName->replace($serverPort, "");
    }

    return new Str($sheme . "://" . $serverName . $serverPort);
  }
455729
public function getDefault()
    {
        // get the memoized default
        if ($this->default) {
            return $this->get($this->default);
        }

        // no configurations available
        // check for existing connections
        if (0 === count($this->config)) {
            if (1 === count($this->connections)) {
                $this->default = array_keys($this->connections)[0];

                return $this->get($this->default);
            } elseif (count($this->connections) > 1) {
                throw new JAQBException('Could not determine the default connection because multiple connections were available and the default has not been set.');
            }

            throw new JAQBException('The default connection is not available because no configurations have been supplied.');
        }

        // handle the case where there is a single configuration
        if (1 === count($this->config)) {
            $this->default = array_keys($this->config)[0];

            return $this->get($this->default);
        }

        // handle multiple configurations
        foreach ($this->config as $k => $v) {
            if (array_value($v, 'default')) {
                $this->default = $k;

                return $this->get($this->default);
            }
        }

        throw new JAQBException('There is no default connection.');
    }
1105033
public function getServerPort()
    {
        if (!$this->port) {
            $default = $this->isSecure() ? 443 : 80;
            $this->setServerPort($this->getServer('SERVER_PORT', $default));
        }
        return $this->port;
    }
213805
public function getDefaultPort()
    {
        if (!$this->hasDefaultPort()) throw new UrlException(sprintf(
            "No default port for URL '%s'",
            $this->_inputString
        ));

        $scheme = $this->getScheme();
        if ($scheme == 'http') return 80;
        elseif ($scheme == 'https') return 443;
        else throw new UrlException("No default port for scheme '$scheme'");
    }
1238525
public static function GetCurrentProtocol () {
		$https_flag = (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') || (isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off');
		return $https_flag ? 'https' : 'http';
	}
903062
public function getSSHConfig()
    {
        $sshConfig = $this->getEnvOption('ssh', ['port' => 22, 'flags' => '-q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no']);

        if ($this->getHostPort() !== null) {
            $sshConfig['port'] = $this->getHostPort();
        }

        if (!array_key_exists('port', $sshConfig)) {
            $sshConfig['port'] = '22';
        }

        if (!array_key_exists('flags', $sshConfig)) {
            $sshConfig['flags'] = '-q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no';
        }

        return $sshConfig;
    }
638704
public SSLSocket getSSLSocket() throws KeystoreException, CommunicationException {
		SSLSocketFactory socketFactory = getSSLSocketFactory();
		logger.debug("Creating SSLSocket to " + getServerHost() + ":" + getServerPort());

		try {
			if (ProxyManager.isUsingProxy(server)) {
				return tunnelThroughProxy(socketFactory);
			} else {
				return (SSLSocket) socketFactory.createSocket(getServerHost(), getServerPort());
			}
		} catch (Exception e) {
			throw new CommunicationException("Communication exception: " + e, e);
		}
	}