Updates +listen+ to enable SSL when the SSL configuration is active.
966550
def listen(address, port) # :nodoc:
      listeners = Utils::create_listeners(address, port, @logger)
      if @config[:SSLEnable]
        unless ssl_context
          @ssl_context = setup_ssl_context(@config)
          @logger.info("\n" + @config[:SSLCertificate].to_text)
        end
        listeners.collect!{|svr|
          ssvr = ::OpenSSL::SSL::SSLServer.new(svr, ssl_context)
          ssvr.start_immediately = @config[:SSLStartImmediately]
          ssvr
        }
      end
      @listeners += listeners
    end
125524
def _update_ssl_config(opts):
    '''
    
    '''
    if opts['ssl'] in (None, False):
        opts['ssl'] = None
        return
    if opts['ssl'] is True:
        opts['ssl'] = {}
        return
    import ssl
    for key, prefix in (('cert_reqs', 'CERT_'),
                        ('ssl_version', 'PROTOCOL_')):
        val = opts['ssl'].get(key)
        if val is None:
            continue
        if not isinstance(val, six.string_types) or not val.startswith(prefix) or not hasattr(ssl, val):
            message = 'SSL option \'{0}\' must be set to one of the following values: \'{1}\'.' \
                    .format(key, '\', \''.join([val for val in dir(ssl) if val.startswith(prefix)]))
            log.error(message)
            raise salt.exceptions.SaltConfigurationError(message)
        opts['ssl'][key] = getattr(ssl, val)
1316725
async def _open_connection_https(self, location):
        '''
        
        '''
        sock = await connect_tcp(location[0],
                                 location[1],
                                 ssl_context=self.ssl_context or ssl.SSLContext(),
                                 bind_host=self.source_address,
                                 autostart_tls=True)
        sock._active = True
        return sock
273167
def ssl?
      @env[Merb::Const::UPCASE_HTTPS] == 'on' || @env[Merb::Const::HTTP_X_FORWARDED_PROTO] == Merb::Const::HTTPS
    end
335394
def update(self):
        
        with self._lock:
            if self._state == Bundle.ACTIVE:
                self.stop()
                self.start()
454006
private void configureSsl(SocketChannel ch) {
        SslContext sslCtx = SslContextBuilder.build();
        ChannelPipeline pipeline = ch.pipeline();
        pipeline.addLast(sslCtx.newHandler(ch.alloc()));
        // We must wait for the handshake to finish and the protocol to be negotiated before configuring
        // the HTTP/2 components of the pipeline.
        pipeline.addLast(new ApplicationProtocolNegotiationHandler("") {
            @Override
            protected void configurePipeline(ChannelHandlerContext ctx, String protocol) {
                if (ApplicationProtocolNames.HTTP_2.equals(protocol)) {
                    ChannelPipeline p = ctx.pipeline();
                    p.addLast(connectionHandler);
                    configureEndOfPipeline(p);
                    return;
                }
                ctx.close();
                throw new IllegalStateException("unknown protocol: " + protocol);
            }
        });
    }
1029627
public void processHttpChainWork(boolean enableEndpoint, boolean isPause) {
        if (enableEndpoint) {
            // enable the endpoint if it is currently disabled
            // it's ok if the endpoint is stopped, the config update will occur @ next start
            endpointState.compareAndSet(DISABLED, ENABLED);

            if (httpPort >= 0) {
                httpChain.enable();
            }
            if (httpsPort >= 0 && sslFactoryProvider.getService() != null) {
                httpSecureChain.enable();
            }

            if (!isPause) {
                // Use an update action so they pick up the new settings
                performAction(updateAction);
            } else {
                updateAction.run();
            }
        } else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(this, tc, "endpoint disabled: " + (String) endpointConfig.get("id"));
            }

            // The endpoint has been disabled-- stop it now
            endpointState.set(DISABLED);
            if (!isPause) {
                performAction(stopAction);
            } else {
                stopAction.run();
            }
        }
    }
512598
protected synchronized void activate(ComponentContext context) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(this, tc, "Activating");
        }
        bContext = context.getBundleContext();
        instance.set(this);

        sslConfigs.activate(context);
        cfwBundle.getFramework().registerFactories(this);
    }
1120920
protected function initSsl()
    {
        if ('system' == ($authority = $this->config[self::SSL_CERT_AUTHORITY])) {
            return;
        }

        if ($authority === null) {
            $authority = true;
        }

        if ($authority === true && substr(__FILE__, 0, 7) == 'phar://') {
            $authority = $this->preparePharCacert();
            $that = $this;
            $this->getEventDispatcher()->addListener('request.before_send', function ($event) use ($authority, $that) {
                if ($authority == $event['request']->getCurlOptions()->get(CURLOPT_CAINFO)) {
                    $that->preparePharCacert(false);
                }
            });
        }

        $this->setSslVerification($authority);
    }
505262
public static void waitForMongoSSL(LibertyServer server) throws Exception {
        // Just because SSL feature is reported as starting doesn't mean it is really ready,
        // nor that Mongo is functional, so wait for SSL to report the keystore has been
        // added, then wait for MongoDBService to activate.
        server.resetLogMarks(); // look from start of logs
        assertNotNull("Did not find trace message indicating SSL trustStore had been added",
                      server.waitForStringInTraceUsingMark("Adding keystore: (myDefaultTrustStore|differentTrustStore)"));
        assertNotNull("Did not find message indicating MongoDBService had activated", server.waitForStringInTraceUsingMark("MongoDBService * < activate"));
    }
966022
def start_executing_host_checks(self):
        
        # todo: #783 create a dedicated brok for global parameters
        if not self.my_conf.execute_host_checks:
            self.my_conf.modified_attributes |= DICT_MODATTR["MODATTR_ACTIVE_CHECKS_ENABLED"].value
            self.my_conf.execute_host_checks = True
            self.my_conf.explode_global_conf()
            self.daemon.update_program_status()
1186698
def on_update_enabled(self, conf_evt):
        
        enabled = conf_evt.value
        # If we do not have any protocol bound and configuration asks us to
        # enable this peer, we try to establish connection again.
        if enabled:
            LOG.info('%s enabled', self)
            if self._protocol and self._protocol.started:
                LOG.error('Tried to enable neighbor that is already enabled')
            else:
                self.state.bgp_state = const.BGP_FSM_CONNECT
                # Restart connect loop if not already running.
                if not self._connect_retry_event.is_set():
                    self._connect_retry_event.set()
                    LOG.debug('Starting connect loop as neighbor is enabled.')
        else:
            LOG.info('%s disabled', self)
            if self._protocol:
                # Stopping protocol will eventually trigger connection_lost
                # handler which will do some clean-up.
                # But the greenlet that is in charge of the socket may be kill
                # when we stop the protocol, hence we call connection_lost
                # here as we triggered socket to close.
                self._protocol.send_notification(
                    BGP_ERROR_CEASE,
                    BGP_ERROR_SUB_ADMINISTRATIVE_SHUTDOWN
                )
                self._protocol.stop()
                self._protocol = None
                self.state.bgp_state = const.BGP_FSM_IDLE
            # If this peer is not enabled any-more we stop trying to make any
            # connection.
            LOG.debug('Disabling connect-retry as neighbor was disabled')
            self._connect_retry_event.clear()
1249614
def activate(options = {})
      options = options.merge(
        user_name: @user_name,
        certificate_id: @id,
        status: "Active"
      )
      resp = @client.update_signing_certificate(options)
      resp.data
    end
438616
public function enable(): void
	{
		$this->response->setCookie(Configurator::COOKIE_SECRET, $this->cookie, strtotime('1 years'), '/', '', '', true);
		$this->enable = true;
	}
1260574
def enable_disable(self):
        
        if self.enabled:
            self.data['enabled'] = False
        else:
            self.data['enabled'] = True
        self.update()
1017135
function onListening() {
		let addr = server.address()
		let bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port
		debug('Listening on ' + bind)
		console.log('Listening on ' + bind)
	}
754013
def add_ssl(http)
      if host.start_with?('https')
        http.use_ssl = true
        http.verify_mode = OpenSSL::SSL::VERIFY_PEER
      end
      http
    end