#include "extensions/transport_sockets/tls/config.h" #include "envoy/extensions/transport_sockets/tls/v3/cert.pb.h" #include "envoy/extensions/transport_sockets/tls/v3/tls.pb.validate.h" #include "common/protobuf/utility.h" #include "extensions/transport_sockets/tls/context_config_impl.h" #include "extensions/transport_sockets/tls/ssl_socket.h" namespace Envoy { namespace Extensions { namespace TransportSockets { namespace Tls { Network::TransportSocketFactoryPtr UpstreamSslSocketFactory::createTransportSocketFactory( const Protobuf::Message& message, Server::Configuration::TransportSocketFactoryContext& context) { auto client_config = std::make_unique( MessageUtil::downcastAndValidate< const envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext&>( message, context.messageValidationVisitor()), context); return std::make_unique(std::move(client_config), context.sslContextManager(), context.scope()); } ProtobufTypes::MessagePtr UpstreamSslSocketFactory::createEmptyConfigProto() { return std::make_unique(); } REGISTER_FACTORY(UpstreamSslSocketFactory, Server::Configuration::UpstreamTransportSocketConfigFactory){"tls"}; Network::TransportSocketFactoryPtr DownstreamSslSocketFactory::createTransportSocketFactory( const Protobuf::Message& message, Server::Configuration::TransportSocketFactoryContext& context, const std::vector& server_names) { auto server_config = std::make_unique( MessageUtil::downcastAndValidate< const envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext&>( message, context.messageValidationVisitor()), context); return std::make_unique( std::move(server_config), context.sslContextManager(), context.scope(), server_names); } ProtobufTypes::MessagePtr DownstreamSslSocketFactory::createEmptyConfigProto() { return std::make_unique(); } REGISTER_FACTORY(DownstreamSslSocketFactory, Server::Configuration::DownstreamTransportSocketConfigFactory){"tls"}; Ssl::ContextManagerPtr SslContextManagerFactory::createContextManager(TimeSource& time_source) { return std::make_unique(time_source); } static Envoy::Registry::RegisterInternalFactory ssl_manager_registered; } // namespace Tls } // namespace TransportSockets } // namespace Extensions } // namespace Envoy