-
-
Notifications
You must be signed in to change notification settings - Fork 97
Closed
Description
I'm using Hyper + Hyper-TLS with the Daemonize crate to make the following HTTPS call from within a Daemon my subprocess runs. Interestingly, if I make a HTTP call things work fine and the request gets POST'ed to my server. However, if I change the BASE_URL to be HTTPS, then I get the following error printed out:
Error {
kind: Connect,
cause: Custom {
kind: Other,
error: Error {
code: -909
I can't find any documentation as to what this might be. Also what's disturbing is that after I print this error, no other print statements are executed because the process seems to have died. Any help would be appreciated. Code using hyper/hyper-tls is below.
let url: hyper::Uri = format!("{}/logs/new", BASE_URL).parse().unwrap();
let https_connector = HttpsConnector::new(4).unwrap();
let client = Client::builder().build(https_connector);
let method = hyper::Method::POST;
let mut headers = HeaderMap::new();
let json_payload = json!({
"jobName": job_name,
"line": line,
});
let mut req = Request::new(Body::from(json_payload.to_string()));
headers.insert("x-access-token", HeaderValue::from_str(&token).unwrap());
headers.insert(
hyper::header::CONTENT_TYPE,
HeaderValue::from_static("application/json")
);
*req.method_mut() = method;
*req.uri_mut() = url;
*req.headers_mut() = headers;
client.request(req).and_then(|res| {
Ok(res.status())
}).from_err::<kraken_utils::FetchError>().from_err()
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels