Initializes the HTTP client.
 It automatically enable +use_ssl+ flag according to +@base_uri+ scheme.
355323
def init_http_client(options)
        http = Net::HTTP.new(@base_uri.host, 443)
        http.use_ssl = true if @base_uri.scheme == "https"
        http.verify_mode = OpenSSL::SSL::VERIFY_NONE # FIXME: not 100% supported
        self.http_client = http
      end
858328
protected function initializeClient()
    {
        // Store some specific soap-client related data locally
        // so it can be injected in the SoapClient and compared
        // for changes later

        $this->wsdl          = $this->request->getLocation();
        $this->clientOptions = $this->request->getOptions();

        // store hash to make it possible to detect changes to the client
        $this->clientHash = $this->makeSoapClientHash();

        $xdebugEnabled = extension_loaded('xdebug') && xdebug_is_enabled();

        try {

            // temporarily disable xdebug to prevent PHP Fatal error
            // while constructing SoapClient

            if ($xdebugEnabled) xdebug_disable();

            $class = $this->soapClientClass;

            $this->client = $this->getSoapClientFactory()->make($class, $this->wsdl, $this->clientOptions);

            if ($xdebugEnabled) xdebug_enable();

        } catch (SoapFault $e) {

            throw new CouldNotConnectException($e->getMessage(), $e->getCode(), $e);

        } catch (Exception $e) {

            throw new CouldNotConnectException($e->getMessage(), $e->getCode(), $e);
        }
    }
1315884
private function initSoapClient() {
        if ($this->soapClient === NULL) {
            $this->soapClient = new SoapClient($this->service, $this->key, $this->cert, $this->trace, $this->passphrase);
        }
    }
157032
protected function init()
    {
        $this->setMethod(static::$_DEFAULT_HTTP_METHOD);
        $this->setHeaders(static::$_DEFAULT_HEADERS);
        $this->setOptions(static::$_DEFAULT_OPTIONS);
        $this->body = NULL;
        $this->error = NULL;
        $this->status = self::STATUS_INIT;
        if (self::$_AUTO_INIT){
            return $this->initCurl();
        }
        return TRUE;
    }
670349
@Override
    protected void initializeImpl()
    {
        String value=this.getConfigurationValue(FaxClientSpiConfigurationConstants.HTTP_CLIENT_CLASS_NAME_PROPERTY_KEY);
        if(value==null)
        {
            value=ApacheHTTPClient.class.getName();
        }

        //create HTTP client
        this.httpClient=(HTTPClient)ReflectionHelper.createInstance(value);
        
        //create configuration
        this.httpClientConfiguration=this.createHTTPClientConfiguration();

        //create fax job to HTTP request converter
        this.faxJob2HTTPRequestConverter=this.createFaxJob2HTTPRequestConverter();

        //create HTTP response handler
        this.httpResponseHandler=this.createHTTPResponseHandler();

        //get resources
        Map<FaxActionType,String> map=this.initializeFaxActionType2ResourceMap();
        this.faxActionType2ResourceMap=new HashMap<FaxActionType,String>(map);
        
        //get URL parameters
        this.urlParameters=this.initializeURLParameters();
    }
1173445
def init_app(self, app):
        """"""
        app.config.setdefault("SSLIFY_SUBDOMAINS", False)
        app.config.setdefault("SSLIFY_PERMANENT", False)
        app.config.setdefault("SSLIFY_SKIPS", None)

        self.hsts_include_subdomains = (
            self.hsts_include_subdomains or app.config["SSLIFY_SUBDOMAINS"]
        )
        self.permanent = self.permanent or self.app.config["SSLIFY_PERMANENT"]
        self.skip_list = self.skip_list or self.app.config["SSLIFY_SKIPS"]

        app.before_request(self.redirect_to_ssl)
        app.after_request(self.set_hsts_header)
729705
private function initHttp()
    {
        $this->di->mapService('core.http', '\Core\Http\Http', [
            'core.http.cookie',
            'core.http.header'
        ]);
        $this->di->mapService('core.http.cookie', '\Core\Http\Cookie\CookieHandler');
        $this->di->mapService('core.http.header', '\Core\Http\Header\HeaderHandler');

        $this->http = $this->di->get('core.http');
    }
1074149
private function initSoapClient()
    {
        if (!isset($this->service))
        {
            throw new ClientException("Not set service");
        }

        if ($this->soapClient === null)
        {
            $this->soapClient = new SoapClient($this->service, $this->cert, $this->trace, $this->curlOptions);
        }
    }
355883
static function Init()
	{
		require_once 'verysimple/Phreeze/Controller.php';
		require_once 'verysimple/HTTP/RequestUtil.php';

		if (!self::$IS_INITIALIZED)
		{
			RequestUtil::NormalizeUrlRewrite();

			Controller::$SmartyViewPrefix = '';
			Controller::$DefaultRedirectMode = 'header';

			self::$IS_INITIALIZED = true;
		}

	}
901255
private void init() {
        mHeaderFields = new Hashtable<>();
        mStartLine = "";
        mMsgHeader = "";
        mMalformedHeader = false;
        mContentLength = -1;
        mLineDelimiter = CRLF;
        mVersion = HttpHeader.HTTP10;
    }
847594
public function init()
    {

        // reset the servlet request
        $httpRequest = $this->getHttpRequest();

        // initialize the parts
        foreach ($httpRequest->getParts() as $part) {
            $this->addPart(Part::fromHttpRequest($part));
        }

        // set the body content if we can find one
        if ($httpRequest->getHeader(HttpProtocol::HEADER_CONTENT_LENGTH) > 0) {
            $this->setBodyStream($httpRequest->getBodyContent());
        }

        // copy server variables to members
        $this->setServerName($this->getServerVar(ServerVars::SERVER_NAME));
        $this->setQueryString($this->getServerVar(ServerVars::QUERY_STRING));
        $this->setRequestUri($this->getServerVar(ServerVars::X_REQUEST_URI));
        $this->setDocumentRoot($this->getServerVar(ServerVars::DOCUMENT_ROOT));
        $this->setRequestUrl($this->getServerVar(ServerVars::HTTP_HOST) . $this->getServerVar(ServerVars::X_REQUEST_URI));
    }
1197730
def initialize_net_http_ssl(uri)
      http = Net::HTTP.new(uri.host, uri.port)

      http.use_ssl = uri.scheme == 'https'

      if defined?(Rails) && Rails.env.test?
        in_rails_test_env = true
      else
        in_rails_test_env = false
      end

      if http.use_ssl? && !in_rails_test_env
        if ca_file
          if File.exists?(ca_file)
            http.ca_file = ca_file
          else
            raise 'Certificate path not found.'
          end
        end

        # Explicitly verifies that the certificate matches the domain.
        # Requires that we use www when calling the production DocuSign API
        http.verify_mode = OpenSSL::SSL::VERIFY_PEER
        http.verify_depth = 5
      else
        http.verify_mode = OpenSSL::SSL::VERIFY_NONE
      end

      http.open_timeout = open_timeout
      http.read_timeout = read_timeout

      http
    end
12693
def init(self):
        """"""
        self.debug('Initializing %r', self)
        proto = self.server.split('://')[0]

        if proto == 'https':
            if hasattr(ssl, 'create_default_context'):
                context = ssl.create_default_context()

                if self.ssl_verify:
                    context.check_hostname = True
                    context.verify_mode = ssl.CERT_REQUIRED
                else:
                    context.check_hostname = False
                    context.verify_mode = ssl.CERT_NONE

                self._http_handler = urllib2.HTTPSHandler(debuglevel=0, context=context)
            else:
                self._http_handler = urllib2.HTTPSHandler(debuglevel=0)
        elif proto == 'http':
            self._http_handler = urllib2.HTTPHandler(debuglevel=0)
        else:
            raise ValueError('Invalid protocol %s' % proto)

        self._api_url = self.server + '/api_jsonrpc.php'
        self._http_headers = {
            'Content-Type': 'application/json-rpc',
            'User-Agent': 'python/zabbix_api',
        }

        if self.httpuser:
            self.debug('HTTP authentication enabled')
            auth = self.httpuser + ':' + self.httppasswd
            self._http_headers['Authorization'] = 'Basic ' + b64encode(auth.encode('utf-8')).decode('ascii')
245845
public void init() throws SSLException {
        if (sslEngine != null) {
            // We already have a SSL engine created, no need to create a new one
            return;
        }

        InetSocketAddress peer = (InetSocketAddress) session
                .getAttribute(SslFilter.PEER_ADDRESS);
        
        // Create the SSL engine here
        if (peer == null) {
            sslEngine = sslContext.createSSLEngine();
        } else {
            sslEngine = sslContext.createSSLEngine(peer.getHostName(), peer.getPort());
        }

        // Initialize the engine in client mode if necessary
        sslEngine.setUseClientMode(parent.isUseClientMode());

        // Initialize the different SslEngine modes
        if (parent.isWantClientAuth()) {
            sslEngine.setWantClientAuth(true);
        }

        if (parent.isNeedClientAuth()) {
            sslEngine.setNeedClientAuth(true);
        }

        if (logger.isTraceEnabled()) {
            List<String> supportedCiphers = toCipherList(sslEngine.getSupportedCipherSuites());
            if (supportedCiphers != null) {
                logger.trace(String.format("Supported SSL/TLS ciphersuites:\n  %s", toCipherString(supportedCiphers)));

            } else {
                logger.trace("Supported SSL/TLS ciphersuites: none");
            }

            List<String> enabledCiphers = toCipherList(sslEngine.getEnabledCipherSuites());
            if (enabledCiphers != null) {
                logger.trace(String.format("Default enabled SSL/TLS ciphersuites:\n  %s", toCipherString(enabledCiphers)));

            } else {
                logger.trace("Enabled SSL/TLS ciphersuites: none");
            }

            if (sslEngine.getWantClientAuth() ||
                sslEngine.getNeedClientAuth()) {
                logger.trace(String.format("Client certificate verification %s", sslEngine.getNeedClientAuth() ? "REQUIRED" : "requested" ));
            }
        }

        // NOTE: We need to modify the MINA code here so that we can properly
        // handle the intersecting of configured and supported ciphersuites;
        // we can only do this AFTER the SSLEngine has been instantiated,
        // since different providers will support different ciphersuites.
 
        String[] enabledCipherSuites = parent.getEnabledCipherSuites();
        if (enabledCipherSuites != null) {
            // The list of enabled ciphers which can be set is the intersection
            // of the supported ciphers list and the list of ciphers to be
            // enabled.
            List<String> supportedCiphers = toCipherList(sslEngine.getSupportedCipherSuites());
            List<String> configuredCiphers = toCipherList(enabledCipherSuites);
            configuredCiphers.retainAll(supportedCiphers);

            if (logger.isTraceEnabled()) {
                logger.trace(String.format("SSL/TLS ciphersuites in use:\n  %s", toCipherString(configuredCiphers)));
            }

            String[] enabledCiphers = configuredCiphers.toArray(new String[configuredCiphers.size()]);
            sslEngine.setEnabledCipherSuites(enabledCiphers);
        }

        String[] protocols = parent.getEnabledProtocols();
        if (protocols == null || protocols.length == 0) {
            // Service didn't configure any protocols. Let us not include SSLv2, SSLv3 protocols
            // by default as there are known vulnerabilities
            protocols = removeSslProtocols(sslEngine.getSupportedProtocols());
        } else {
            boolean sslv3Enabled = isSslv3Enabled(protocols);
            if (sslv3Enabled && logger.isWarnEnabled()) {
                logger.warn("SSLv3 protocol is enabled. SSLv3 known to have vulnerabilities");
            }
        }
        if (logger.isTraceEnabled()) {
            logger.trace(String.format("SSL/TLS enabled protocols are: %s", Arrays.asList(protocols)));
        }
        sslEngine.setEnabledProtocols(protocols);

        // TODO : we may not need to call this method...
        sslEngine.beginHandshake();
        
        handshakeStatus = sslEngine.getHandshakeStatus();

        handshakeComplete = false;
        initialHandshakeComplete = false;
        writingEncryptedData = false;
    }
440942
def build_http_object(uri)
      http = Net::HTTP.new(uri.host, uri.port)
      http.use_ssl = true if uri.scheme == 'https'
      if @ssl_enabled
        http.cert_store = @cert_store if @cert_store
      else http.verify_mode = OpenSSL::SSL::VERIFY_NONE
      end
      http.read_timeout = @timeout if @timeout # Timeout for a request
      http.open_timeout = @timeout if @timeout # Timeout for a connection
      http
    end
939591
public function initClient()
    {
        list($this->queueName, , ) = $this->channel->queue_declare('', false, false, true, true);
        $this->requests = 0;
        $this->replies = array();
    }
878233
private function initializeClient()
    {
        $this->client = new Client($this->guzzleConfig);

        if ($this->isInDebugMode()) {
            $this->setDebugger();
        }
        if ($this->needsAuthentication()) {
            $this->authenticate();
        }

        return $this->client;
    }