Skip to content

Commit b75b8ca

Browse files
authored
Interconnect: allow using not only RSA keys. Set max supported TLS version to 1.3 (#7954)
1 parent 78b9827 commit b75b8ca

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ydb/library/actors/interconnect/interconnect_stream.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,10 @@ namespace NInterconnect {
276276
RSA_free(rsa);
277277
}
278278

279+
void operator ()(EVP_PKEY *pKey) const {
280+
EVP_PKEY_free(pKey);
281+
}
282+
279283
void operator ()(SSL_CTX *ctx) const {
280284
SSL_CTX_free(ctx);
281285
}
@@ -297,7 +301,7 @@ namespace NInterconnect {
297301
Y_ABORT_UNLESS(Ctx, "SSL_CTX_new() failed");
298302
ret = SSL_CTX_set_min_proto_version(Ctx.get(), TLS1_2_VERSION);
299303
Y_ABORT_UNLESS(ret == 1, "failed to set min proto version");
300-
ret = SSL_CTX_set_max_proto_version(Ctx.get(), TLS1_2_VERSION);
304+
ret = SSL_CTX_set_max_proto_version(Ctx.get(), TLS1_3_VERSION);
301305
Y_ABORT_UNLESS(ret == 1, "failed to set max proto version");
302306
#endif
303307
SSL_CTX_set_verify(Ctx.get(), SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, &Verify);
@@ -328,9 +332,9 @@ namespace NInterconnect {
328332
if (privateKey) {
329333
std::unique_ptr<BIO, TDeleter> bio(BIO_new_mem_buf(privateKey.data(), privateKey.size()));
330334
Y_ABORT_UNLESS(bio);
331-
std::unique_ptr<RSA, TDeleter> pkey(PEM_read_bio_RSAPrivateKey(bio.get(), nullptr, nullptr, nullptr));
335+
std::unique_ptr<EVP_PKEY, TDeleter> pkey(PEM_read_bio_PrivateKey(bio.get(), nullptr, nullptr, nullptr));
332336
Y_ABORT_UNLESS(pkey);
333-
ret = SSL_CTX_use_RSAPrivateKey(Ctx.get(), pkey.get());
337+
ret = SSL_CTX_use_PrivateKey(Ctx.get(), pkey.get());
334338
Y_ABORT_UNLESS(ret == 1);
335339
}
336340
if (caFilePath) {

0 commit comments

Comments
 (0)