32 #include <openssl/ssl.h>
33 #include <openssl/err.h>
34 #include <openssl/rand.h>
35 #include <openssl/conf.h>
36 #include <openssl/evp.h>
37 #include <openssl/hmac.h>
48 GSsl::OpenSSL::LibraryImp::LibraryImp(
G::StringArray & library_config , Library::LogFn log_fn ,
bool verbose ) :
52 m_config(library_config)
54 SSL_load_error_strings() ;
56 int rc = RAND_status() ; G_IGNORE_VARIABLE(rc) ;
57 OpenSSL_add_all_digests() ;
60 m_index = SSL_get_ex_new_index( 0 ,
nullptr ,
nullptr ,
nullptr ,
nullptr ) ;
64 throw Error(
"SSL_get_ex_new_index" ) ;
68 GSsl::OpenSSL::LibraryImp::~LibraryImp()
73 void GSsl::OpenSSL::LibraryImp::cleanup()
78 CRYPTO_cleanup_all_ex_data();
81 std::string GSsl::OpenSSL::LibraryImp::sid()
96 std::string GSsl::OpenSSL::LibraryImp::credit(
const std::string & prefix ,
const std::string & eol ,
const std::string & eot )
98 std::ostringstream ss ;
100 << prefix <<
"This product includes software developed by the OpenSSL Project" << eol
101 << prefix <<
"for use in the OpenSSL Toolkit (http://www.openssl.org/)" << eol
107 const std::string & key_file ,
const std::string & cert_file ,
const std::string & ca_file ,
108 const std::string & default_peer_certificate_name ,
const std::string & default_peer_host_name ,
109 const std::string & profile_config )
111 shared_ptr<ProfileImp> profile_ptr(
112 new ProfileImp(*
this,is_server_profile,key_file,cert_file,ca_file,
113 default_peer_certificate_name,default_peer_host_name,profile_config) ) ;
114 m_profile_map.insert( Map::value_type(profile_name,profile_ptr) ) ;
119 Map::const_iterator p = m_profile_map.find( profile_name ) ;
120 return p != m_profile_map.end() ;
125 Map::const_iterator p = m_profile_map.find( profile_name ) ;
126 if( p == m_profile_map.end() )
throw Error(
"no such profile: [" + profile_name +
"]" ) ;
127 return *(*p).second.get() ;
130 GSsl::Library::LogFn GSsl::OpenSSL::LibraryImp::log()
const
135 bool GSsl::OpenSSL::LibraryImp::verbose()
const
140 int GSsl::OpenSSL::LibraryImp::index()
const
154 result.push_back(
"SHA512" ) ;
155 result.push_back(
"SHA256" ) ;
156 result.push_back(
"SHA1" ) ;
157 result.push_back(
"MD5" ) ;
167 GSsl::OpenSSL::DigesterImp::DigesterImp(
const std::string & hash_type ,
const std::string & state ) :
168 m_evp_ctx(EVP_MD_CTX_create())
170 const EVP_MD * md = EVP_get_digestbyname( hash_type.c_str() ) ;
172 throw Error(
"unsupported hash function name: [" + hash_type +
"]" ) ;
174 m_block_size =
static_cast<size_t>( EVP_MD_block_size(md) ) ;
175 m_value_size =
static_cast<size_t>( EVP_MD_size(md) ) ;
178 if( m_state_size == 0U && !state.empty() )
179 throw Error(
"hash state resoration not implemented for " + hash_type ) ;
181 EVP_DigestInit_ex( m_evp_ctx , md , 0 ) ;
184 GSsl::OpenSSL::DigesterImp::~DigesterImp()
186 EVP_MD_CTX_destroy( m_evp_ctx ) ;
191 return m_block_size ;
196 return m_value_size ;
201 return m_state_size ;
206 return std::string() ;
211 EVP_DigestUpdate( m_evp_ctx , data.data() , data.size() ) ;
216 std::vector<unsigned char> output( EVP_MAX_MD_SIZE ) ;
217 unsigned int output_size = 0 ;
218 EVP_DigestFinal_ex( m_evp_ctx , &output[0] , &output_size ) ;
219 char * p =
reinterpret_cast<char*
>(&output[0]) ;
220 size_t n =
static_cast<size_t>(output_size) ;
221 return std::string( p , n ) ;
226 GSsl::OpenSSL::ProfileImp::ProfileImp(
const LibraryImp & library_imp ,
bool is_server_profile ,
227 const std::string & key_file ,
const std::string & cert_file ,
const std::string & ca_path ,
228 const std::string & default_peer_certificate_name ,
const std::string & default_peer_host_name ,
229 const std::string & profile_config ) :
230 m_library_imp(library_imp) ,
231 m_default_peer_certificate_name(default_peer_certificate_name) ,
232 m_default_peer_host_name(default_peer_host_name) ,
233 m_ssl_ctx(nullptr,
std::ptr_fun(deleter))
235 Config extra_config = m_library_imp.config() ;
236 if( !profile_config.empty() )
239 extra_config =
Config( profile_config_list ) ;
240 if( !profile_config_list.empty() )
241 G_WARNING(
"GSsl::OpenSSL::ProfileImp::ctor: tls-config: tls " << (is_server_profile?
"server":
"client")
242 <<
" profile configuration ignored: [" <<
G::Str::join(
",",profile_config_list) <<
"]" ) ;
245 if( m_ssl_ctx.get() == nullptr )
247 Config::Fn version_fn = extra_config.fn( is_server_profile ) ;
248 m_ssl_ctx.reset( SSL_CTX_new( version_fn() ) ) ;
249 if( m_ssl_ctx.get() != nullptr )
250 apply( extra_config ) ;
253 if( m_ssl_ctx.get() == nullptr )
254 throw Error(
"SSL_CTX_new" , ERR_get_error() ) ;
256 if( !key_file.empty() )
260 G_WARNING(
"GSsl::Profile: cannot open ssl key file: " + key_file ) ;
262 check( SSL_CTX_use_PrivateKey_file(m_ssl_ctx.get(),key_file.c_str(),SSL_FILETYPE_PEM) ,
263 "use_PrivateKey_file" , key_file ) ;
266 if( !cert_file.empty() )
270 G_WARNING(
"GSsl::Profile: cannot open ssl certificate file: " + cert_file ) ;
272 check( SSL_CTX_use_certificate_chain_file(m_ssl_ctx.get(),cert_file.c_str()) ,
273 "use_certificate_chain_file" , cert_file ) ;
276 if( ca_path.empty() )
280 SSL_CTX_set_verify( m_ssl_ctx.get() , SSL_VERIFY_PEER , verifyPass ) ;
282 else if( ca_path ==
"<none>" )
285 SSL_CTX_set_verify( m_ssl_ctx.get() , SSL_VERIFY_NONE , nullptr ) ;
287 else if( ca_path ==
"<default>" )
290 bool no_verify = extra_config.noverify() ;
291 SSL_CTX_set_verify( m_ssl_ctx.get() , no_verify ? SSL_VERIFY_NONE : (SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT) , verifyPeerName ) ;
292 check( SSL_CTX_set_default_verify_paths( m_ssl_ctx.get() ) ,
"set_default_verify_paths" ) ;
298 const char * ca_file_p = ca_path_is_dir ?
nullptr : ca_path.c_str() ;
299 const char * ca_dir_p = ca_path_is_dir ? ca_path.c_str() : nullptr ;
300 bool no_verify = extra_config.noverify() ;
301 SSL_CTX_set_verify( m_ssl_ctx.get() , no_verify ? SSL_VERIFY_NONE : (SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT) , verifyPeerName ) ;
302 check( SSL_CTX_load_verify_locations( m_ssl_ctx.get() , ca_file_p , ca_dir_p ) ,
"load_verify_locations" , ca_path ) ;
305 SSL_CTX_set_quiet_shutdown( m_ssl_ctx.get() , 1 ) ;
306 SSL_CTX_set_cipher_list( m_ssl_ctx.get() ,
"DEFAULT" ) ;
307 SSL_CTX_set_session_cache_mode( m_ssl_ctx.get() , SSL_SESS_CACHE_OFF ) ;
308 if( is_server_profile )
310 static std::string x =
"GSsl.OpenSSL." +
G::Path(G::Process::exe()).
basename() ;
311 SSL_CTX_set_session_id_context( m_ssl_ctx.get() ,
reinterpret_cast<const unsigned char *
>(x.data()) , x.size() ) ;
315 GSsl::OpenSSL::ProfileImp::~ProfileImp()
319 void GSsl::OpenSSL::ProfileImp::deleter( SSL_CTX * p )
326 const std::string & peer_host_name )
const
330 peer_certificate_name.empty()?defaultPeerCertificateName():peer_certificate_name ,
331 peer_host_name.empty()?defaultPeerHostName():peer_host_name ) ;
334 SSL_CTX * GSsl::OpenSSL::ProfileImp::p()
const
336 return const_cast<SSL_CTX*
>( m_ssl_ctx.get() ) ;
341 return m_library_imp ;
344 const std::string & GSsl::OpenSSL::ProfileImp::defaultPeerCertificateName()
const
346 return m_default_peer_certificate_name ;
349 const std::string & GSsl::OpenSSL::ProfileImp::defaultPeerHostName()
const
351 return m_default_peer_host_name ;
354 void GSsl::OpenSSL::ProfileImp::check(
int rc ,
const std::string & fnname_tail ,
const std::string & file )
358 std::string fnname =
"SSL_CTX_" + fnname_tail ;
359 throw Error( fnname , ERR_get_error() , file ) ;
363 void GSsl::OpenSSL::ProfileImp::apply(
const Config & config )
365 #if GCONFIG_HAVE_OPENSSL_MIN_MAX
367 SSL_CTX_set_min_proto_version( m_ssl_ctx.get() , config.min_() ) ;
370 SSL_CTX_set_max_proto_version( m_ssl_ctx.get() , config.max_() ) ;
372 if( config.reset() != 0L )
373 SSL_CTX_clear_options( m_ssl_ctx.get() , config.reset() ) ;
375 if( config.set() != 0L )
376 SSL_CTX_set_options( m_ssl_ctx.get() , config.set() ) ;
380 int GSsl::OpenSSL::ProfileImp::verifyPass(
int ok , X509_STORE_CTX * )
385 int GSsl::OpenSSL::ProfileImp::verifyPeerName(
int ok , X509_STORE_CTX * ctx )
389 if( ok && X509_STORE_CTX_get_error_depth(ctx) == 0 )
391 using namespace GSsl ;
392 SSL * ssl =
reinterpret_cast<SSL*
>( X509_STORE_CTX_get_ex_data( ctx , SSL_get_ex_data_X509_STORE_CTX_idx() ) ) ;
if(ssl==
nullptr)
throw 1 ;
395 std::string required_peer_certificate_name = protocol->requiredPeerCertificateName() ;
396 if( !required_peer_certificate_name.empty() )
398 X509 * cert = X509_STORE_CTX_get_current_cert( ctx ) ;
399 std::string subject = name(X509_get_subject_name(cert)) ;
401 bool found = std::find( subject_parts.begin() , subject_parts.end() ,
"CN="+required_peer_certificate_name ) != subject_parts.end() ;
402 library.log()( 2 ,
"certificate-subject=[" + subject +
"] required-peer-name=[" + required_peer_certificate_name +
"] ok=" + (found?
"1":
"0") ) ;
417 std::string GSsl::OpenSSL::ProfileImp::name( X509_NAME * x509_name )
419 if( x509_name ==
nullptr )
return std::string() ;
420 std::vector<char> buffer( 2048U ) ;
421 X509_NAME_oneline( x509_name , &buffer[0] , buffer.size() ) ;
422 buffer.back() =
'\0' ;
428 GSsl::OpenSSL::ProtocolImp::ProtocolImp(
const ProfileImp & profile ,
const std::string & required_peer_certificate_name ,
429 const std::string & target_peer_host_name ) :
431 m_ssl(nullptr,
std::ptr_fun(deleter)) ,
432 m_log_fn(profile.lib().log()) ,
433 m_verbose(profile.lib().verbose()) ,
435 m_required_peer_certificate_name(required_peer_certificate_name) ,
438 m_ssl.reset( SSL_new(profile.p()) ) ;
439 if( m_ssl.get() == nullptr )
440 throw Error(
"SSL_new" , ERR_get_error() ) ;
443 if( !target_peer_host_name.empty() )
444 SSL_set_tlsext_host_name( m_ssl.get() , target_peer_host_name.c_str() ) ;
447 SSL_set_ex_data( m_ssl.get() , profile.lib().index() , this ) ;
450 GSsl::OpenSSL::ProtocolImp::~ProtocolImp()
454 void GSsl::OpenSSL::ProtocolImp::deleter( SSL * p )
460 void GSsl::OpenSSL::ProtocolImp::clearErrors()
464 Error::clearErrors() ;
467 int GSsl::OpenSSL::ProtocolImp::error(
const char * op ,
int rc )
const
469 int e = SSL_get_error( m_ssl.get() , rc ) ;
474 GSsl::Protocol::Result GSsl::OpenSSL::ProtocolImp::convert(
int e )
476 if( e == SSL_ERROR_WANT_READ )
return Protocol::Result_read ;
477 if( e == SSL_ERROR_WANT_WRITE )
return Protocol::Result_write ;
478 return Protocol::Result_error ;
493 void GSsl::OpenSSL::ProtocolImp::set(
int fd )
497 int rc = SSL_set_fd( m_ssl.get() , fd ) ;
499 throw Error(
"SSL_set_fd" , ERR_get_error() ) ;
503 BIO_set_callback( SSL_get_rbio(m_ssl.get()) , BIO_debug_callback ) ;
504 BIO_set_callback( SSL_get_wbio(m_ssl.get()) , BIO_debug_callback ) ;
514 int rc = SSL_connect( m_ssl.get() ) ;
518 return Protocol::Result_ok ;
522 return convert(error(
"SSL_connect",rc)) ;
526 return convert(error(
"SSL_connect",rc)) ;
533 int rc = SSL_accept( m_ssl.get() ) ;
537 return Protocol::Result_ok ;
541 return convert(error(
"SSL_accept",rc)) ;
545 return convert(error(
"SSL_accept",rc)) ;
549 void GSsl::OpenSSL::ProtocolImp::saveResult()
551 m_peer_certificate = Certificate(SSL_get_peer_certificate(m_ssl.get()),
true).str() ;
552 m_peer_certificate_chain = CertificateChain(SSL_get_peer_cert_chain(m_ssl.get())).str() ;
553 m_verified = !m_peer_certificate.empty() && SSL_get_verify_result(m_ssl.get()) == X509_V_OK ;
558 int rc = SSL_shutdown( m_ssl.get() ) ;
559 return rc == 1 ? Protocol::Result_ok : Protocol::Result_error ;
567 int buffer_size =
static_cast<int>(buffer_size_in) ;
568 int rc = SSL_read( m_ssl.get() , buffer , buffer_size ) ;
571 read_size =
static_cast<ssize_t
>(rc) ;
572 return SSL_pending(m_ssl.get()) ? Protocol::Result_more : Protocol::Result_ok ;
576 return convert(error(
"SSL_read",rc)) ;
580 return convert(error(
"SSL_read",rc)) ;
588 int size =
static_cast<int>(size_in) ;
589 int rc = SSL_write( m_ssl.get() , buffer , size ) ;
592 size_out =
static_cast<ssize_t
>(rc) ;
593 return Protocol::Result_ok ;
597 return convert(error(
"SSL_write",rc)) ;
601 return convert(error(
"SSL_write",rc)) ;
607 return m_peer_certificate ;
612 return m_peer_certificate_chain ;
620 void GSsl::OpenSSL::ProtocolImp::logErrors(
const std::string & op ,
int rc ,
int e ,
const std::string & strerr )
const
622 if( m_log_fn !=
nullptr )
626 std::ostringstream ss ;
627 ss << op <<
": rc=" << rc <<
": error " << e <<
" => " << strerr ;
628 (*m_log_fn)( 1 , ss.str() ) ;
631 unsigned long ee = 0 ;
632 for(
int i = 2 ; i < 10000 ; i++ )
634 ee = ERR_get_error() ;
635 if( ee == 0 ) break ;
636 Error eee( op , ee ) ;
637 (*m_log_fn)( 3 , std::string() + eee.what() ) ;
642 std::string GSsl::OpenSSL::ProtocolImp::requiredPeerCertificateName()
const
644 return m_required_peer_certificate_name ;
649 GSsl::OpenSSL::Error::Error(
const std::string & s ) :
650 m_what(
"tls error: " + s )
654 GSsl::OpenSSL::Error::Error(
const std::string & fnname ,
unsigned long e ) :
655 m_what(
"tls error: " + fnname +
"(): [" + text(e) +
"]" )
660 GSsl::OpenSSL::Error::Error(
const std::string & fnname ,
unsigned long e ,
const std::string & file ) :
661 m_what(
"tls error: " + fnname +
"(): [" + text(e) +
"]: file=[" + file +
"]" )
666 void GSsl::OpenSSL::Error::clearErrors()
668 for(
int i = 0 ; ERR_get_error() && i < 10000 ; i++ )
672 GSsl::OpenSSL::Error::~Error() throw ()
676 const char * GSsl::OpenSSL::Error::what()
const throw ()
678 return m_what.c_str() ;
681 std::string GSsl::OpenSSL::Error::text(
unsigned long e )
683 std::vector<char> v( 300 ) ;
684 ERR_error_string_n( e , &v[0] , v.size() ) ;
685 std::string s( &v[0] , v.size() ) ;
686 return std::string( s.c_str() ) ;
691 GSsl::OpenSSL::CertificateChain::CertificateChain( STACK_OF(X509) * chain )
693 for(
int i = 0 ; chain !=
nullptr && i < sk_X509_num(chain) ; i++ )
695 void * p = sk_X509_value(chain,i) ;
if( p ==
nullptr ) break ;
696 X509 * x509 =
reinterpret_cast<X509*
>(p) ;
697 m_str.append( Certificate(x509,
false).str() ) ;
701 std::string GSsl::OpenSSL::CertificateChain::str()
const
708 GSsl::OpenSSL::Certificate::Certificate( X509 * x509 ,
bool do_free )
710 if( x509 ==
nullptr ) return ;
711 BIO * bio = BIO_new( BIO_s_mem() ) ;
712 int rc = PEM_write_bio_X509( bio , x509 ) ;
714 BUF_MEM * mem = nullptr ;
715 BIO_get_mem_ptr( bio , &mem ) ;
716 size_t n = mem ?
static_cast<size_t>(mem->length) : 0U ;
717 const char * p = mem ? mem->data : nullptr ;
718 std::string data = p&&n ? std::string(p,n) :
std::string() ;
720 if( do_free ) X509_free( x509 ) ;
729 std::string GSsl::OpenSSL::Certificate::str()
const
740 m_options_reset(0L) ,
741 m_noverify(consume(cfg,
"noverify"))
743 #if GCONFIG_HAVE_OPENSSL_SSLv23_METHOD
744 m_server_fn = SSLv23_server_method ;
745 m_client_fn = SSLv23_client_method ;
747 m_server_fn = TLS_server_method ;
748 m_client_fn = TLS_client_method ;
751 #if GCONFIG_HAVE_OPENSSL_MIN_MAX
754 if( consume(cfg,
"sslv3") ) m_min = SSL3_VERSION ;
755 if( consume(cfg,
"-sslv3") ) m_max = SSL3_VERSION ;
758 if( consume(cfg,
"tlsv1.0") ) m_min = TLS1_VERSION ;
759 if( consume(cfg,
"-tlsv1.0") ) m_max = TLS1_VERSION ;
761 #ifdef TLS1_1_VERSION
762 if( consume(cfg,
"tlsv1.1") ) m_min = TLS1_1_VERSION ;
763 if( consume(cfg,
"-tlsv1.1") ) m_max = TLS1_1_VERSION ;
765 #ifdef TLS1_2_VERSION
766 if( consume(cfg,
"tlsv1.2") ) m_min = TLS1_2_VERSION ;
767 if( consume(cfg,
"-tlsv1.2") ) m_max = TLS1_2_VERSION ;
772 #ifndef SSL_OP_NO_SSLv2
773 const long SSL_OP_NO_SSLv2 = 0L ;
775 #ifndef SSL_OP_NO_SSLv3
776 const long SSL_OP_NO_SSLv3 = 0L ;
781 #if GCONFIG_HAVE_OPENSSL_SSLv23_METHOD
782 else if( consume(cfg,
"sslv2") )
796 else if( consume(cfg,
"sslv3") )
798 #if GCONFIG_HAVE_OPENSSL_SSLv3_METHOD
799 if( consume(cfg,
"-sslv3") )
801 m_server_fn = SSLv3_server_method ;
802 m_client_fn = SSLv3_client_method ;
819 else if( consume(cfg,
"tlsv1.0") )
821 #if GCONFIG_HAVE_OPENSSL_TLSv1_METHOD
822 if( consume(cfg,
"-tlsv1.0") )
824 m_server_fn = TLSv1_server_method ;
825 m_client_fn = TLSv1_client_method ;
842 else if( consume(cfg,
"tlsv1.1") )
844 #if GCONFIG_HAVE_OPENSSL_TLSv1_1_METHOD
845 if( consume(cfg,
"-tlsv1.1") )
847 m_server_fn = TLSv1_1_server_method ;
848 m_client_fn = TLSv1_1_client_method ;
865 else if( consume(cfg,
"tlsv1.2") )
867 #if GCONFIG_HAVE_OPENSSL_TLSv1_2_METHOD
868 if( consume(cfg,
"-tlsv1.2") )
870 m_server_fn = TLSv1_2_server_method ;
871 m_client_fn = TLSv1_2_client_method ;
889 if( consume(cfg,
"-sslv3") )
897 else if( consume(cfg,
"-tlsv1.0") )
904 else if( consume(cfg,
"-tlsv1.1") )
913 bool GSsl::OpenSSL::Config::consume(
G::StringArray & list ,
const std::string & item )
918 GSsl::OpenSSL::Config::Fn GSsl::OpenSSL::Config::fn(
bool server )
920 return server ? m_server_fn : m_client_fn ;
923 long GSsl::OpenSSL::Config::set()
const
925 return m_options_set ;
928 long GSsl::OpenSSL::Config::reset()
const
930 return m_options_reset ;
933 int GSsl::OpenSSL::Config::min_()
const
938 int GSsl::OpenSSL::Config::max_()
const
943 bool GSsl::OpenSSL::Config::noverify()
const
std::string peerCertificateChain() const
Implements Protocol::peerCertificateChain().
A base interface for profile classes that work with concrete classes derived from GSsl::LibraryImpBas...
An interface to an underlying TLS library.
static std::string printable(const std::string &in, char escape= '\\')
Returns a printable represention of the given input string.
An abstract interface for reading and writing from a non-blocking i/o channel.
A base interface for GSsl::Protocol pimple classes.
Result write(const char *buffer, size_t size_in, ssize_t &size_out)
Implements Protocol::write().
Result accept(G::ReadWrite &)
Implements Protocol::accept().
virtual Digester digester(const std::string &, const std::string &) const override
Implements Library::digester().
virtual G::StringArray digesters(bool) const override
Implements Library::digesters().
virtual ProtocolImpBase * newProtocol(const std::string &, const std::string &) const override
Factory method for a new Protocol object on the heap.
Result stop()
Implements Protocol::stop().
std::string basename() const
Returns the rightmost part of the path, ignoring "." parts.
std::vector< std::string > StringArray
A std::vector of std::strings.
static bool isDirectory(const Path &path)
Returns true if the path exists() and is a directory.
A class which acquires the process's special privileges on construction and releases them on destruct...
static void splitIntoTokens(const std::string &in, StringArray &out, const std::string &ws)
Splits the string into 'ws'-delimited tokens.
static std::string str(Result result)
Converts a result enumeration into a printable string.
An implementation of the GSsl::LibraryImpBase interface for OpenSSL.
virtual void add(const std::string &) override
Implements Digester::add().
static LibraryImpBase & impstance()
Returns a reference to the pimple object when enabled().
virtual size_t statesize() const override
Implements Digester::statesize().
Holds protocol version information, etc.
static unsigned int replaceAll(std::string &s, const std::string &from, const std::string &to)
Does a global replace on string 's', replacing all occurances of sub-string 'from' with 'to'...
virtual SOCKET fd() const =0
Returns the file descriptor.
An exception class for GSsl::OpenSSL classes.
Returns an object that can perform a cryptographic hash.
static bool enabled()
Returns true if test features are enabled.
static bool consume(G::StringArray &list, const std::string &item)
A convenience function that removes the item from the list and returns true iff is was removed...
bool verified() const
Implements Protocol::verified().
static bool exists(const Path &file)
Returns true if the file (directory, device etc.) exists.
virtual void addProfile(const std::string &name, bool is_server_profile, const std::string &key_file, const std::string &cert_file, const std::string &ca_file, const std::string &default_peer_certificate_name, const std::string &default_peer_host_name, const std::string &profile_config) override
Implements Library::addProfile().
An implementation of the GSsl::DigesterImpBase interface for OpenSSL.
Result read(char *buffer, size_t buffer_size, ssize_t &read_size)
Implements Protocol::read().
virtual size_t valuesize() const override
Implements Digester::valuesize().
Result connect(G::ReadWrite &)
Implements Protocol::connect().
std::string peerCertificate() const
Implements Protocol::peerCertificate().
static std::string join(const std::string &sep, const StringArray &strings)
Concatenates an array of strings with separators.
virtual size_t blocksize() const override
Implements Digester::blocksize().
virtual bool hasProfile(const std::string &) const override
Implements Library::hasProfile().
virtual std::string state() override
Implements Digester::state().
TLS/SSL transport layer security classes.
virtual std::string id() const override
Implements Library::id().
virtual const GSsl::Profile & profile(const std::string &) const override
Implements Library::profile().
virtual std::string value() override
Implements Digester::value().
A Path object represents a file system path.
An implementation of the GSsl::ProtocolImpBase interface for OpenSSL.
An implementation of the GSsl::Profile interface for OpenSSL.