Changeset 2090
- Timestamp:
- 07/02/2008 17:37:00 (11 months ago)
- Location:
- box/trunk/lib/server
- Files:
-
- 4 modified
-
SSLLib.cpp (modified) (2 diffs)
-
SSLLib.h (modified) (1 diff)
-
SocketStreamTLS.cpp (modified) (6 diffs)
-
TLSContext.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/lib/server/SSLLib.cpp
r1789 r2090 64 64 // 65 65 // -------------------------------------------------------------------------- 66 void SSLLib::LogError(const char *ErrorDuringAction)66 void SSLLib::LogError(const std::string& rErrorDuringAction) 67 67 { 68 68 unsigned long errcode; … … 71 71 { 72 72 ::ERR_error_string_n(errcode, errname, sizeof(errname)); 73 BOX_ERROR("SSL error during " <<ErrorDuringAction << ": " <<73 BOX_ERROR("SSL error while " << rErrorDuringAction << ": " << 74 74 errname); 75 75 } -
box/trunk/lib/server/SSLLib.h
r217 r2090 30 30 { 31 31 void Initialise(); 32 void LogError(const char *ErrorDuringAction);32 void LogError(const std::string& rErrorDuringAction); 33 33 }; 34 34 -
box/trunk/lib/server/SocketStreamTLS.cpp
r1086 r2090 124 124 if(mpBIO == 0) 125 125 { 126 SSLLib::LogError(" Createsocket bio");126 SSLLib::LogError("creating socket bio"); 127 127 THROW_EXCEPTION(ServerException, TLSAllocationFailed) 128 128 } … … 135 135 if(mpSSL == 0) 136 136 { 137 SSLLib::LogError(" Create ssl");137 SSLLib::LogError("creating SSL object"); 138 138 THROW_EXCEPTION(ServerException, TLSAllocationFailed) 139 139 } … … 203 203 if(IsServer) 204 204 { 205 SSLLib::LogError(" Accept");205 SSLLib::LogError("accepting connection"); 206 206 THROW_EXCEPTION(ConnectionException, Conn_TLSHandshakeFailed) 207 207 } 208 208 else 209 209 { 210 SSLLib::LogError(" Connect");210 SSLLib::LogError("connecting"); 211 211 THROW_EXCEPTION(ConnectionException, Conn_TLSHandshakeFailed) 212 212 } … … 335 335 336 336 default: 337 SSLLib::LogError(" Read");337 SSLLib::LogError("reading"); 338 338 THROW_EXCEPTION(ConnectionException, Conn_TLSReadFailed) 339 339 break; … … 400 400 401 401 default: 402 SSLLib::LogError(" Write");402 SSLLib::LogError("writing"); 403 403 THROW_EXCEPTION(ConnectionException, Conn_TLSWriteFailed) 404 404 break; … … 442 442 if(::SSL_shutdown(mpSSL) < 0) 443 443 { 444 SSLLib::LogError(" Shutdown");444 SSLLib::LogError("shutting down"); 445 445 THROW_EXCEPTION(ConnectionException, Conn_TLSShutdownFailed) 446 446 } -
box/trunk/lib/server/TLSContext.cpp
r1150 r2090 76 76 if(::SSL_CTX_use_certificate_chain_file(mpContext, CertificatesFile) != 1) 77 77 { 78 SSLLib::LogError("Load certificates"); 78 std::string msg = "loading certificates from "; 79 msg += CertificatesFile; 80 SSLLib::LogError(msg); 79 81 THROW_EXCEPTION(ServerException, TLSLoadCertificatesFailed) 80 82 } 81 83 if(::SSL_CTX_use_PrivateKey_file(mpContext, PrivateKeyFile, SSL_FILETYPE_PEM) != 1) 82 84 { 83 SSLLib::LogError("Load private key"); 85 std::string msg = "loading private key from "; 86 msg += PrivateKeyFile; 87 SSLLib::LogError(msg); 84 88 THROW_EXCEPTION(ServerException, TLSLoadPrivateKeyFailed) 85 89 } … … 88 92 if(::SSL_CTX_load_verify_locations(mpContext, TrustedCAsFile, NULL) != 1) 89 93 { 90 SSLLib::LogError("Load CA cert"); 94 std::string msg = "loading CA cert from "; 95 msg += TrustedCAsFile; 96 SSLLib::LogError(msg); 91 97 THROW_EXCEPTION(ServerException, TLSLoadTrustedCAsFailed) 92 98 } … … 100 106 if(::SSL_CTX_set_cipher_list(mpContext, CIPHER_LIST) != 1) 101 107 { 102 SSLLib::LogError(" Set cipher list");108 SSLLib::LogError("setting cipher list to " CIPHER_LIST); 103 109 THROW_EXCEPTION(ServerException, TLSSetCiphersFailed) 104 110 }
