@@ -73,8 +73,21 @@ void InitializeOpenSSL()
73
73
l_SSLInitialized = true ;
74
74
}
75
75
76
- static void InitSslContext (const Shared<TlsContext>::Ptr & context, const String& pubkey, const String& privkey, const String& cakey)
76
+ /* *
77
+ * Initializes an SSL context using the specified certificates.
78
+ *
79
+ * @param pubkey The public key.
80
+ * @param privkey The matching private key.
81
+ * @param cakey CA certificate chain file.
82
+ * @returns An SSL context.
83
+ */
84
+ Shared<TlsContext>::Ptr MakeAsioSslContext (const String& pubkey, const String& privkey, const String& cakey)
77
85
{
86
+ namespace ssl = boost::asio::ssl;
87
+
88
+ InitializeOpenSSL ();
89
+
90
+ auto context (Shared<TlsContext>::Make (TlsContext::tls));
78
91
char errbuf[256 ];
79
92
80
93
// Enforce TLS v1.2 as minimum
@@ -193,25 +206,6 @@ static void InitSslContext(const Shared<TlsContext>::Ptr& context, const String&
193
206
194
207
SSL_CTX_set_client_CA_list (sslContext, cert_names);
195
208
}
196
- }
197
-
198
- /* *
199
- * Initializes an SSL context using the specified certificates.
200
- *
201
- * @param pubkey The public key.
202
- * @param privkey The matching private key.
203
- * @param cakey CA certificate chain file.
204
- * @returns An SSL context.
205
- */
206
- Shared<TlsContext>::Ptr MakeAsioSslContext (const String& pubkey, const String& privkey, const String& cakey)
207
- {
208
- namespace ssl = boost::asio::ssl;
209
-
210
- InitializeOpenSSL ();
211
-
212
- auto context (Shared<TlsContext>::Make (TlsContext::tls));
213
-
214
- InitSslContext (context, pubkey, privkey, cakey);
215
209
216
210
return context;
217
211
}
0 commit comments