Skip to content

Commit

Permalink
Prepare v0.1.13-beta (#372)
Browse files Browse the repository at this point in the history
  • Loading branch information
richarddavison authored May 10, 2024
1 parent 8043098 commit 2b28a6e
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 25 deletions.
19 changes: 14 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
- Fix JSON.stringify of undefined values
- Implemeted some fs sync APIs
- Updated dependencies
- Remove `assert` in favor of `expect` for testing
- Minor fixes
- Added URL as a module
- Added navigator.userAgent
- Implemented AbortController/AbortSignal
- Port Lambda Runtime Interface Client to Rust (perf improvement)
- Increase fetch compat (abort signal, response encoding/decompression, redirect handling)
- Implemented DOMException
- Dependency updates
- Bundle @aws-sdk/client-cognito-identity-provider
- HTTP/2 support
- Expose crypto on global this
- Bug fixes

Full list of changes:
https://github.com/awslabs/llrt/compare/v0.1.12-beta...v0.1.13-beta
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion llrt/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "llrt"
version = "0.1.12-beta"
version = "0.1.13-beta"
edition = "2021"
license-file = "LICENSE"

Expand Down
2 changes: 1 addition & 1 deletion llrt_core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "llrt_core"
version = "0.1.12-beta"
version = "0.1.13-beta"
edition = "2021"
license-file = "LICENSE"

Expand Down
1 change: 1 addition & 0 deletions llrt_core/src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pub const ENV_LLRT_NET_ALLOW: &str = "LLRT_NET_ALLOW";
pub const ENV_LLRT_NET_DENY: &str = "LLRT_NET_DENY";
pub const ENV_LLRT_NET_POOL_IDLE_TIMEOUT: &str = "LLRT_NET_POOL_IDLE_TIMEOUT";
pub const ENV_LLRT_HTTP_VERSION: &str = "LLRT_HTTP_VERSION";
pub const ENV_LLRT_TLS_VERSION: &str = "LLRT_TLS_VERSION";

//log
pub const ENV_LLRT_LOG: &str = "LLRT_LOG";
Expand Down
32 changes: 16 additions & 16 deletions llrt_core/src/modules/net/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use rquickjs::{
module::{Declarations, Exports, ModuleDef},
Ctx, Result,
};
use rustls::{crypto::ring, ClientConfig, RootCertStore};
use rustls::{crypto::ring, version, ClientConfig, RootCertStore};
use tracing::warn;
use webpki_roots::TLS_SERVER_ROOTS;

Expand Down Expand Up @@ -46,17 +46,13 @@ pub static HTTP_CLIENT: Lazy<Client<HttpsConnector<HttpConnector>, Full<Bytes>>>
Lazy::new(|| {
let pool_idle_timeout: u64 = get_pool_idle_timeout();

let builder = hyper_rustls::HttpsConnectorBuilder::new()
.with_tls_config(TLS_CONFIG.clone())
.https_or_http();

let https = match env::var(environment::ENV_LLRT_HTTP_VERSION).as_deref() {
Ok("1.1") => hyper_rustls::HttpsConnectorBuilder::new()
.with_tls_config(TLS_CONFIG.clone())
.https_or_http()
.enable_http1()
.build(),
_ => hyper_rustls::HttpsConnectorBuilder::new()
.with_tls_config(TLS_CONFIG.clone())
.https_or_http()
.enable_all_versions()
.build(),
Ok("1.1") => builder.enable_http1().build(),
_ => builder.enable_all_versions().build(),
};

Client::builder(TokioExecutor::new())
Expand All @@ -72,11 +68,15 @@ pub static TLS_CONFIG: Lazy<ClientConfig> = Lazy::new(|| {
root_certificates.roots.push(cert)
}

ClientConfig::builder_with_provider(ring::default_provider().into())
.with_safe_default_protocol_versions()
.unwrap()
.with_root_certificates(root_certificates)
.with_no_client_auth()
let builder = ClientConfig::builder_with_provider(ring::default_provider().into());

match env::var(environment::ENV_LLRT_TLS_VERSION).as_deref() {
Ok("1.3") => builder.with_safe_default_protocol_versions(),
_ => builder.with_protocol_versions(&[&version::TLS12]), //Use TLS 1.2 by default to increase compat and keep latency low
}
.unwrap()
.with_root_certificates(root_certificates)
.with_no_client_auth()
});

pub struct NetModule;
Expand Down

0 comments on commit 2b28a6e

Please sign in to comment.