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

allow https scheme for loading dump #697

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions sqld/src/http/admin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use axum::routing::delete;
use axum::Json;
use chrono::NaiveDateTime;
use futures::TryStreamExt;
use hyper::Body;
use serde::Deserialize;
use std::io::ErrorKind;
use std::sync::Arc;
Expand Down Expand Up @@ -134,8 +135,13 @@ async fn handle_fork_namespace<M: MakeNamespace>(

async fn dump_stream_from_url(url: &Url) -> Result<DumpStream, LoadDumpError> {
match url.scheme() {
"http" => {
let client = hyper::client::Client::new();
"http" | "https" => {
let connector = hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.https_or_http()
.enable_http1()
.build();
let client = hyper::client::Client::builder().build::<_, Body>(connector);
let uri = url
.as_str()
.parse()
Expand Down