Changeset 504

Show
Ignore:
Timestamp:
08/15/07 09:57:49 (1 year ago)
Author:
blackhedd
Message:

added SetTlsParms?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • version_0/ext/ed.cpp

    r454 r504  
    624624                throw std::runtime_error ("SSL/TLS already running on connection"); 
    625625 
    626         SslBox = new SslBox_t (bIsServer); 
     626        SslBox = new SslBox_t (bIsServer, PrivateKeyFilename, CertChainFilename); 
    627627        _DispatchCiphertext(); 
     628        #endif 
     629 
     630        #ifdef WITHOUT_SSL 
     631        throw std::runtime_error ("Encryption not available on this event-machine"); 
     632        #endif 
     633} 
     634 
     635 
     636/********************************* 
     637ConnectionDescriptor::SetTlsParms 
     638*********************************/ 
     639 
     640void ConnectionDescriptor::SetTlsParms (const char *privkey_filename, const char *certchain_filename) 
     641{ 
     642        #ifdef WITH_SSL 
     643        if (SslBox) 
     644                throw std::runtime_error ("call SetTlsParms before calling StartTls"); 
     645        if (privkey_filename && *privkey_filename) 
     646                PrivateKeyFilename = privkey_filename; 
     647        if (certchain_filename && *certchain_filename) 
     648                CertChainFilename = certchain_filename; 
    628649        #endif 
    629650 
  • version_0/ext/ed.h

    r501 r504  
    6666 
    6767                virtual void StartTls() {} 
     68                virtual void SetTlsParms (const char *privkey_filename, const char *certchain_filename) {} 
    6869 
    6970                // Properties: return 0/1 to signify T/F, and handle the values 
     
    149150 
    150151                virtual void StartTls(); 
     152                virtual void SetTlsParms (const char *privkey_filename, const char *certchain_filename); 
    151153                void SetServerMode() {bIsServer = true;} 
    152154 
     
    175177                #ifdef WITH_SSL 
    176178                SslBox_t *SslBox; 
     179                std::string CertChainFilename; 
     180                std::string PrivateKeyFilename; 
    177181                #endif 
    178182                bool bIsServer;