@@ -72,18 +72,18 @@ void InitializeOpenSSL()
72
72
l_SSLInitialized = true ;
73
73
}
74
74
75
- static void InitSslContext (const Shared<boost::asio::ssl::context >::Ptr & context, const String& pubkey, const String& privkey, const String& cakey)
75
+ static void InitSslContext (const Shared<SslContext >::Ptr & context, const String& pubkey, const String& privkey, const String& cakey)
76
76
{
77
77
char errbuf[256 ];
78
78
79
79
// Enforce TLS v1.2 as minimum
80
80
context->set_options (
81
- boost::asio::ssl::context ::default_workarounds |
82
- boost::asio::ssl::context ::no_compression |
83
- boost::asio::ssl::context ::no_sslv2 |
84
- boost::asio::ssl::context ::no_sslv3 |
85
- boost::asio::ssl::context ::no_tlsv1 |
86
- boost::asio::ssl::context ::no_tlsv1_1
81
+ SslContext ::default_workarounds |
82
+ SslContext ::no_compression |
83
+ SslContext ::no_sslv2 |
84
+ SslContext ::no_sslv3 |
85
+ SslContext ::no_tlsv1 |
86
+ SslContext ::no_tlsv1_1
87
87
);
88
88
89
89
// Custom TLS flags
@@ -202,13 +202,13 @@ static void InitSslContext(const Shared<boost::asio::ssl::context>::Ptr& context
202
202
* @param cakey CA certificate chain file.
203
203
* @returns An SSL context.
204
204
*/
205
- Shared<boost::asio::ssl::context >::Ptr MakeAsioSslContext (const String& pubkey, const String& privkey, const String& cakey)
205
+ Shared<SslContext >::Ptr MakeAsioSslContext (const String& pubkey, const String& privkey, const String& cakey)
206
206
{
207
207
namespace ssl = boost::asio::ssl;
208
208
209
209
InitializeOpenSSL ();
210
210
211
- auto context (Shared<ssl::context >::Make (ssl::context ::tls));
211
+ auto context (Shared<SslContext >::Make (SslContext ::tls));
212
212
213
213
InitSslContext (context, pubkey, privkey, cakey);
214
214
@@ -220,7 +220,7 @@ Shared<boost::asio::ssl::context>::Ptr MakeAsioSslContext(const String& pubkey,
220
220
* @param context The ssl context.
221
221
* @param cipherList The ciper list.
222
222
**/
223
- void SetCipherListToSSLContext (const Shared<boost::asio::ssl::context >::Ptr & context, const String& cipherList)
223
+ void SetCipherListToSSLContext (const Shared<SslContext >::Ptr & context, const String& cipherList)
224
224
{
225
225
char errbuf[256 ];
226
226
@@ -278,12 +278,12 @@ int ResolveTlsProtocolVersion(const std::string& version) {
278
278
}
279
279
}
280
280
281
- Shared<boost::asio::ssl::context >::Ptr SetupSslContext (String certPath, String keyPath,
281
+ Shared<SslContext >::Ptr SetupSslContext (String certPath, String keyPath,
282
282
String caPath, String crlPath, String cipherList, String protocolmin, DebugInfo di)
283
283
{
284
284
namespace ssl = boost::asio::ssl;
285
285
286
- Shared<ssl::context >::Ptr context;
286
+ Shared<SslContext >::Ptr context;
287
287
288
288
try {
289
289
context = MakeAsioSslContext (certPath, keyPath, caPath);
@@ -327,7 +327,7 @@ Shared<boost::asio::ssl::context>::Ptr SetupSslContext(String certPath, String k
327
327
* @param context The ssl context.
328
328
* @param tlsProtocolmin The minimum TLS protocol version.
329
329
*/
330
- void SetTlsProtocolminToSSLContext (const Shared<boost::asio::ssl::context >::Ptr & context, const String& tlsProtocolmin)
330
+ void SetTlsProtocolminToSSLContext (const Shared<SslContext >::Ptr & context, const String& tlsProtocolmin)
331
331
{
332
332
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
333
333
int ret = SSL_CTX_set_min_proto_version (context->native_handle (), ResolveTlsProtocolVersion (tlsProtocolmin));
@@ -355,7 +355,7 @@ void SetTlsProtocolminToSSLContext(const Shared<boost::asio::ssl::context>::Ptr&
355
355
* @param context The SSL context.
356
356
* @param crlPath The path to the CRL file.
357
357
*/
358
- void AddCRLToSSLContext (const Shared<boost::asio::ssl::context >::Ptr & context, const String& crlPath)
358
+ void AddCRLToSSLContext (const Shared<SslContext >::Ptr & context, const String& crlPath)
359
359
{
360
360
X509_STORE *x509_store = SSL_CTX_get_cert_store (context->native_handle ());
361
361
AddCRLToSSLContext (x509_store, crlPath);
0 commit comments