Sets the port and keystore information on the SSL connector if it already
exists; creates a new SSL connector, otherwise. Also sets the
redirectPort on the non-SSL connector to match.

@throws InstallationFailedException
169155
public void setSSLPort() throws InstallationFailedException {
        Element httpsConnector =
                (Element) getDocument()
                        .selectSingleNode(HTTPS_CONNECTOR_XPATH);
        if (options.getBooleanValue(InstallOptions.SSL_AVAILABLE, true)) {
            if (httpsConnector == null) {
                Element service =
                        (Element) getDocument()
                                .selectSingleNode("/Server/Service[@name='Catalina']");
                httpsConnector = service.addElement("Connector");
                httpsConnector.addAttribute("maxThreads", "150");
                httpsConnector.addAttribute("minSpareThreads", "25");
                httpsConnector.addAttribute("maxSpareThreads", "75");
                httpsConnector.addAttribute("disableUploadTimeout", "true");
                httpsConnector.addAttribute("acceptCount", "100");
                httpsConnector.addAttribute("debug", "0");
                httpsConnector.addAttribute("scheme", "https");
                httpsConnector.addAttribute("secure", "true");
                httpsConnector.addAttribute("clientAuth", "false");
                httpsConnector.addAttribute("sslProtocol", "TLS");
            }
            httpsConnector.addAttribute("port", options
                    .getValue(InstallOptions.TOMCAT_SSL_PORT));
            httpsConnector.addAttribute("enableLookups", "true"); // supports client dns/fqdn in xacml authz policies

            String keystore = options.getValue(InstallOptions.KEYSTORE_FILE);
            if (keystore.equals(InstallOptions.INCLUDED)) {
                keystore = KEYSTORE_LOCATION;
            }

            addAttribute(httpsConnector,
                         "keystoreFile",
                         keystore,
                         InstallOptions.DEFAULT);
            addAttribute(httpsConnector,
                         "keystorePass",
                         options.getValue(InstallOptions.KEYSTORE_PASSWORD),
                         KEYSTORE_PASSWORD_DEFAULT);
            addAttribute(httpsConnector,
                         "keystoreType",
                         options.getValue(InstallOptions.KEYSTORE_TYPE),
                         KEYSTORE_TYPE_DEFAULT);

            // The redirectPort for the non-SSL connector should match the port on
            // the SSL connector, per:
            // http://tomcat.apache.org/tomcat-5.0-doc/ssl-howto.html
            Element httpConnector =
                    (Element) getDocument()
                            .selectSingleNode(HTTP_CONNECTOR_XPATH);
            if (httpConnector != null) {
                httpConnector.addAttribute("redirectPort", options
                        .getValue(InstallOptions.TOMCAT_SSL_PORT));
            } else {
                throw new InstallationFailedException("Unable to set server.xml SSL Port. XPath for Connector element failed.");
            }
        } else if (httpsConnector != null) {
            httpsConnector.getParent().remove(httpsConnector);
        }
    }
401367
SamlPortConfigBuilder setSchemeAndPortIfAbsent(ServerPort serverPort) {
        requireNonNull(serverPort, "serverPort");
        if (serverPort.hasHttps()) {
            setSchemeIfAbsent(SessionProtocol.HTTPS);
        } else if (serverPort.hasHttp()) {
            setSchemeIfAbsent(SessionProtocol.HTTP);
        } else {
            throw new IllegalArgumentException("unexpected session protocol: " + serverPort.protocols());
        }

        // Do not set a port if the port number is 0 which means that the port will be automatically chosen.
        final int port = serverPort.localAddress().getPort();
        if (isValidPort(port)) {
            setPortIfAbsent(port);
        }
        return this;
    }
927734
static InstallException create(RepositoryException e, Throwable cause, RestRepositoryConnectionProxy proxy, boolean defaultRepo) {

        if (proxy != null && cause instanceof UnknownHostException)
            return create(Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("ERROR_TOOL_UNKNOWN_PROXY_HOST", proxy.getProxyURL().getHost()), e);
        else if (cause instanceof ConnectException && cause.getMessage() != null && cause.getMessage().contains("Connection refused") && proxy != null)
            return create(Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("ERROR_TOOL_INCORRECT_PROXY_PORT", String.valueOf(proxy.getProxyURL().getPort())),
                          e);
        else if (isCertPathBuilderException(cause))
            return create(Messages.INSTALL_KERNEL_MESSAGES.getLogMessage(defaultRepo ? "ERROR_FAILED_TO_CONNECT_CAUSED_BY_CERT" : "ERROR_FAILED_TO_CONNECT_REPOS_CAUSED_BY_CERT"),
                          e, InstallException.RUNTIME_EXCEPTION);
        else
            return create(Messages.INSTALL_KERNEL_MESSAGES.getLogMessage(defaultRepo ? "ERROR_FAILED_TO_CONNECT" : "ERROR_FAILED_TO_CONNECT_REPOS"),
                          e, InstallException.RUNTIME_EXCEPTION);
    }
1017467
public function connect()
    {

          //if port is not set, try and determine based on transport
        if(!is_numeric($this->port)){
            if(substr($this->host, 0, 3) == 'ssl'){
                $this->port = 5223;
                $this->log("Connecting with SSL");

            } else {
                $this->port = 5222;
            }
        }

        parent::__construct($this->host.':'.$this->port, $this->timeout);

        $this->open();

        //begin stream
        $this->write("<stream:stream to='$this->host' xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams' xml:lang='en' version='1.0'>");

        $this->read();
        $this->read();

        $this->connected = true;

    }
1064967
public void setSSLSocketFactory() {
        if (isClassAvailable(SOCKET_FACTORY_CLASS)) {
            AccessController.doPrivileged(
                                          new PrivilegedAction<Object>() {
                                              @Override
                                              public Object run() {
                                                  Security.setProperty(SOCKET_FACTORY_PROP,
                                                                       SOCKET_FACTORY_CLASS);
                                                  return null;
                                              }
                                          });
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "Socket factory set:" +
                         "com.ibm.ws.kernel.boot.security.SSLSocketFactoryProxy");
    }
852483
protected void initStores() throws SecurityDomainException {
        setDomainEnvironment();

        char[] keyStorePasswd = domainProperties.getProperty(JAVAX_NET_SSL_KEYSTORE_PASSWORD, "").toCharArray();
        char[] trustStorePasswd = domainProperties.getProperty(JAVAX_NET_SSL_TRUSTSTORE_PASSWORD, "").toCharArray();

        String keyStoreName = domainProperties.getProperty(JAVAX_NET_SSL_KEYSTORE, null);
        if (logger.isDebugEnabled())
            logger.debug("Name of key store for security domain " + name + " is " + keyStoreName);
        if (keyStoreName == null) {
            restoreSystemEnvironment();
            throw new SecurityDomainException(name, "Key Store file is undefined");
        }

        String trustStoreName = domainProperties.getProperty(JAVAX_NET_SSL_TRUSTSTORE, null);
        if (logger.isDebugEnabled()) {
            if (trustStoreName != null) {
                logger.debug("Name of trust store for security domain " + name + " is " + trustStoreName);
            } else {
                logger.debug("Name of trust store for security domain " + name + " was not defined. Default trust store from JVM will be used");
            }
        }

        // Key Store
        try {
            InputStream keystoreInputStream = preBufferInputStream(new FileInputStream(keyStoreName));
            initKeyStore(keystoreInputStream, keyStorePasswd);
            if (logger.isDebugEnabled())
                logger.debug("Key store for security domain " + name + " initialized successfully");
        } catch (NoSuchAlgorithmException e) {
            String msg = "Error: Key Store Manager Algorithm " + KeyManagerFactory.getDefaultAlgorithm() + " is not supported. " + e.getLocalizedMessage();
            logger.error(msg);
            restoreSystemEnvironment();
            throw new SecurityDomainException(name, msg, e);
        } catch (CertificateException | IOException | UnrecoverableKeyException e) {
            String msg = "Error loading key store file " + keyStoreName + ".  " + e.getLocalizedMessage();
            logger.error(msg);
            restoreSystemEnvironment();
            throw new SecurityDomainException(name, msg, e);
        }

        if (trustStoreName != null) {
            // Trust Store
            try {
                InputStream trustoreInputStream = preBufferInputStream(new FileInputStream(trustStoreName));
                initTrustStore(trustoreInputStream, trustStorePasswd);
                if (logger.isDebugEnabled())
                    logger.debug("Trust store for security domain " + name + " initialized successfully");

            } catch (NoSuchAlgorithmException e) {
                String msg = "Error: Key Store Manager Algorithm " + KeyManagerFactory.getDefaultAlgorithm() + " is not supported. " + e.getLocalizedMessage();
                logger.error(msg);
                restoreSystemEnvironment();
                throw new SecurityDomainException(name, msg, e);
            } catch (CertificateException e) {
                String msg = "Error loading trust store file " + trustStoreName + ".  " + e.getLocalizedMessage();
                logger.error(msg);
                restoreSystemEnvironment();
                throw new SecurityDomainException(name, msg, e);
            } catch (IOException e) {
                String msg = "Error loading trust store file " + trustStoreName + ".  " + e.getLocalizedMessage();
                logger.error(msg);
                restoreSystemEnvironment();
                throw new SecurityDomainException(name, msg, e);
            }
        }
        restoreSystemEnvironment();
    }
1202044
public function install()
    {
        if (0 === $this->isolator->error_reporting()) {
            throw new ErrorHandlingConfigurationException();
        }

        if ($this->isInstalled()) {
            throw new AlreadyInstalledException();
        }

        $this->stack->push($this);
    }
478514
protected void setSsl(ServiceReference<Object> reference) {
        sslConfigurationRef.setReference(reference);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "sslRef set to " + reference.getProperty(CONFIG_DISPLAY_ID));
        }
    }
1201364
@Override
    public void setConnectionProximity(String newConnectionProximity) throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setConnectionProximity", newConnectionProximity);

        // Check for null and empty string, and set to default value if found
        if ((newConnectionProximity == null) || ("".equals(newConnectionProximity))) {
            jcaManagedConnectionFactory.setConnectionProximity(ApiJmsConstants.CONNECTION_PROXIMITY_BUS);
        }
        //ensure that the value is one of the permitted constants - if not throw an exception
        else if ((ApiJmsConstants.CONNECTION_PROXIMITY_BUS.equals(newConnectionProximity))
                 || (ApiJmsConstants.CONNECTION_PROXIMITY_HOST.equals(newConnectionProximity))
                 || (ApiJmsConstants.CONNECTION_PROXIMITY_CLUSTER.equals(newConnectionProximity))
                 || (ApiJmsConstants.CONNECTION_PROXIMITY_SERVER.equals(newConnectionProximity))) {
            jcaManagedConnectionFactory.setConnectionProximity(newConnectionProximity);
        }
        else {
            throw (JMSException) JmsErrorUtils.newThrowable(
                                                            JMSException.class,
                                                            "INVALID_VALUE_CWSIA0261",
                                                            new Object[] { "connectionProximity", newConnectionProximity },
                                                            tc
                            );
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setConnectionProximity");
    }
1294601
public void setConnectionFactory(XAConnectionFactory connectionFactory) {
		this.connectionFactory = connectionFactory;
		setClassName(DirectXAConnectionFactory.class.getName());
		setDriverProperties(new Properties());
	}
1145330
protected function registerRedirection(): void
    {
        if (! empty($this->redirectAfterInstalled) && \is_string($this->redirectAfterInstalled)) {
            Installation::$redirectAfterInstalled = $this->redirectAfterInstalled;
        }
    }
1151686
public synchronized void setDefaultSSLContext() throws Exception {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.entry(tc, "setDefaultSSLContext");

        if (FrameworkState.isStopping()) {
            return;
        }

        SSLConfig defaultSSLConfig = getDefaultSSLConfig();

        if (defaultSSLConfig != null)
            JSSEProviderFactory.getInstance(null).setServerDefaultSSLContext(defaultSSLConfig);
        else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "There is no default SSLConfig.");
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.exit(tc, "setDefaultSSLContext");

    }
126424
def clientConnectionFailed(self, connector, reason):
        
        log.debug("Connect failed: %s", reason)
        self.conn.defunct(reason.value)
879321
public void setTrustStore(String pathToTrustStore, String trustStorePassword) {
        File tsFD = new File(pathToTrustStore != null && !pathToTrustStore.trim().isEmpty() ? pathToTrustStore : "");
        if (!tsFD.exists() || !tsFD.isFile() || !tsFD.canRead()) {
            throw new IllegalArgumentException("Trust store " + pathToTrustStore + " is not a read accessible file");
        }
        m_sslConfig = new SSLConfiguration.SslConfig(null, null, pathToTrustStore, trustStorePassword);
    }
1089585
public void setDirectConnection(RespokeDirectConnection newDirectConnection) {
        if (null != newDirectConnection) {
            directConnectionReference = new WeakReference<RespokeDirectConnection>(newDirectConnection);
        } else {
            directConnectionReference = null;
        }
    }
92483
def set_https_port(port=443):
    '''
    
    '''
    _current = global_settings()

    if _current['Global Settings']['HTTP_PORT']['VALUE'] == port:
        return True

    _xml = """<RIBCL VERSION="2.0">
                <LOGIN USER_LOGIN="adminname" PASSWORD="password">
                  <RIB_INFO MODE="write">
                    <MOD_GLOBAL_SETTINGS>
                      <HTTPS_PORT value="{0}"/>
                    </MOD_GLOBAL_SETTINGS>
                  </RIB_INFO>
                </LOGIN>
              </RIBCL>""".format(port)

    return __execute_cmd('Set_HTTPS_Port', _xml)
1022610
public void setKeyStore(String keyStore, String keyPass, String keyManagerType, String keyStoreType) 
    {
        if((keyStore == null) || (keyPass == null))
        {
            this.keyStore =  System.getProperty("javax.net.ssl.keyStore");
            this.keyPass = System.getProperty("javax.net.ssl.keyStorePassword");
        }
        else
        {
            this.keyStore = keyStore;
            this.keyPass = keyPass;
        }
        
        if (keyManagerType != null) {
            this.keyManagerType = keyManagerType;
        }
        if (keyStoreType != null) {
            this.keyStoreType = keyStoreType;
        }
        isKeyStoreSet = (keyStore != null) && (keyPass != null);
    }