Skip to content

Commit

Permalink
Switch to hyper-rustls to allow static builds
Browse files Browse the repository at this point in the history
  • Loading branch information
aengelas committed Apr 11, 2023
1 parent 41213b7 commit b79b502
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ keywords = ["rollbar", "logging", "errors", "exceptions"]
backtrace = "0.3"
futures = "0.3"
hyper = { version = "0.14", features = ["full"] }
hyper-tls = "0.5"
hyper-rustls = "0.24"
serde = "1.0"
serde_json = "1.0"
serde_derive = "1.0"
Expand Down
8 changes: 6 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use std::{error, fmt, panic};
use backtrace::Backtrace;
use futures::TryFutureExt;
use hyper::{Body, Method, Request};
use hyper_tls::HttpsConnector;
use hyper_rustls::{HttpsConnector, HttpsConnectorBuilder};

#[derive(Clone, Debug)]
pub struct ErrorMessage {
Expand Down Expand Up @@ -566,7 +566,11 @@ impl Client {
/// You can get the `access_token` at
/// <https://rollbar.com/{your_organization}/{your_app}/settings/access_tokens>.
pub fn new<T: Into<String>>(access_token: T, environment: T) -> Client {
let https = HttpsConnector::new();
let https = HttpsConnectorBuilder::new()
.with_native_roots()
.https_only()
.enable_http1()
.build();
let client = hyper::Client::builder().build::<_, Body>(https);

Client {
Expand Down

0 comments on commit b79b502

Please sign in to comment.