Skip to content

Commit

Permalink
Fix OpenSSL 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
james58899 committed Sep 13, 2023
1 parent d9a615b commit 485aca6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ fn create_ssl_acceptor(cert: &ParsedPkcs12_2) -> SslAcceptorBuilder {
// Not have AES hardware acceleration, perfer ChaCha20.
builder
.set_cipher_list(
"ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:\
"@SECLEVEL=0:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:\
ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:\
ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:\
DHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:\
Expand All @@ -413,7 +413,7 @@ fn create_ssl_acceptor(cert: &ParsedPkcs12_2) -> SslAcceptorBuilder {

builder
.set_cipher_list(
"ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:\
"@SECLEVEL=0:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:\
ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:\
ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:\
DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305:\
Expand All @@ -433,7 +433,7 @@ fn create_ssl_acceptor(cert: &ParsedPkcs12_2) -> SslAcceptorBuilder {
builder.set_private_key(cert.pkey.as_ref().unwrap()).unwrap();
builder.set_certificate(cert.cert.as_ref().unwrap()).unwrap();
if let Some(i) = &cert.ca {
i.iter().rev().for_each(|j| builder.add_extra_chain_cert(j.to_owned()).unwrap());
i.iter().for_each(|j| builder.add_extra_chain_cert(j.to_owned()).unwrap());
}
builder
}
Expand Down
3 changes: 2 additions & 1 deletion src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use futures::{executor::block_on, TryFutureExt};
use log::{debug, error, info, warn};
use openssl::{
asn1::Asn1Time,
pkcs12::{ParsedPkcs12_2, Pkcs12},
pkcs12::{ParsedPkcs12_2, Pkcs12}, provider::Provider,
};
use parking_lot::{RwLock, RwLockUpgradableReadGuard};
use rand::prelude::SliceRandom;
Expand Down Expand Up @@ -197,6 +197,7 @@ impl RPCClient {
}

pub async fn get_cert(&self) -> Option<ParsedPkcs12_2> {
let _provider = Provider::try_load(None, "legacy", true).unwrap();
let cert = self
.reqwest
.get(self.build_url("get_cert", "", None))
Expand Down

0 comments on commit 485aca6

Please sign in to comment.