Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit 5183ded

Browse files
committed
allow https scheme for loading dump
1 parent 15c333d commit 5183ded

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

sqld/src/http/admin/mod.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use axum::routing::delete;
44
use axum::Json;
55
use chrono::NaiveDateTime;
66
use futures::TryStreamExt;
7+
use hyper::Body;
78
use serde::Deserialize;
89
use std::io::ErrorKind;
910
use std::sync::Arc;
@@ -134,8 +135,13 @@ async fn handle_fork_namespace<M: MakeNamespace>(
134135

135136
async fn dump_stream_from_url(url: &Url) -> Result<DumpStream, LoadDumpError> {
136137
match url.scheme() {
137-
"http" => {
138-
let client = hyper::client::Client::new();
138+
"http" | "https" => {
139+
let connector = hyper_rustls::HttpsConnectorBuilder::new()
140+
.with_native_roots()
141+
.https_or_http()
142+
.enable_http1()
143+
.build();
144+
let client = hyper::client::Client::builder().build::<_, Body>(connector);
139145
let uri = url
140146
.as_str()
141147
.parse()

0 commit comments

Comments
 (0)