feat: Add --unsafely-treat-insecure-origin-as-secure flag to disable SSL verification (#11324)

This commit adds "--unsafely-treat-insecure-origin-as-secure" flag 
that allows to disable SSL verification for all domains, or specific
domains if they were passed as an argument to the flag.

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
TheAifam5 2021-08-09 16:53:21 +02:00 committed by GitHub
parent 3ab50b3551
commit 353a4a1af3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 284 additions and 12 deletions

View file

@ -223,6 +223,7 @@ impl FileFetcher {
allow_remote: bool,
root_cert_store: Option<RootCertStore>,
blob_store: BlobStore,
unsafely_treat_insecure_origin_as_secure: Option<Vec<String>>,
) -> Result<Self, AnyError> {
Ok(Self {
auth_tokens: AuthTokens::new(env::var(DENO_AUTH_TOKENS).ok()),
@ -235,6 +236,7 @@ impl FileFetcher {
root_cert_store,
None,
None,
unsafely_treat_insecure_origin_as_secure,
)?,
blob_store,
})
@ -618,6 +620,7 @@ mod tests {
true,
None,
blob_store.clone(),
None,
)
.expect("setup failed");
(file_fetcher, temp_dir, blob_store)
@ -1063,6 +1066,7 @@ mod tests {
true,
None,
BlobStore::default(),
None,
)
.expect("setup failed");
let result = file_fetcher
@ -1090,6 +1094,7 @@ mod tests {
true,
None,
BlobStore::default(),
None,
)
.expect("could not create file fetcher");
let specifier =
@ -1118,6 +1123,7 @@ mod tests {
true,
None,
BlobStore::default(),
None,
)
.expect("could not create file fetcher");
let result = file_fetcher_02
@ -1279,6 +1285,7 @@ mod tests {
true,
None,
BlobStore::default(),
None,
)
.expect("could not create file fetcher");
let specifier =
@ -1310,6 +1317,7 @@ mod tests {
true,
None,
BlobStore::default(),
None,
)
.expect("could not create file fetcher");
let result = file_fetcher_02
@ -1420,6 +1428,7 @@ mod tests {
false,
None,
BlobStore::default(),
None,
)
.expect("could not create file fetcher");
let specifier =
@ -1447,6 +1456,7 @@ mod tests {
true,
None,
BlobStore::default(),
None,
)
.expect("could not create file fetcher");
let file_fetcher_02 = FileFetcher::new(
@ -1455,6 +1465,7 @@ mod tests {
true,
None,
BlobStore::default(),
None,
)
.expect("could not create file fetcher");
let specifier =