-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle SSL errors gracefully (#3271)
Task/Issue URL: https://app.asana.com/0/72649045549333/1207295365843956/f If users visit a page with certificate or other security issues, provide warning information and allow users to proceed (if they choose to).
- Loading branch information
Showing
18 changed files
with
674 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
appId: com.duckduckgo.mobile.ios | ||
tags: | ||
- privacy | ||
|
||
--- | ||
|
||
# Set up | ||
- runFlow: | ||
file: ../shared/setup.yaml | ||
|
||
- assertVisible: | ||
id: "searchEntry" | ||
|
||
# Test 1 - Leave the dangerous site | ||
- tapOn: | ||
id: "searchEntry" | ||
- inputText: "https://expired.badssl.com" | ||
- pressKey: Enter | ||
- assertVisible: "Warning: This site may be insecure" | ||
- assertNotVisible: | ||
id: "LogoIcon" | ||
- tapOn: "Leave This Site" | ||
- assertNotVisible: "Warning: This site may be insecure" | ||
|
||
# Test 2 - Visit the dangerous site | ||
- tapOn: | ||
id: "searchEntry" | ||
- inputText: "https://expired.badssl.com" | ||
- pressKey: Enter | ||
- tapOn: "Advanced" | ||
- scroll | ||
- tapOn: "Accept Risk and Visit Site" | ||
- assertVisible: | ||
id: "LogoIcon" | ||
- assertVisible: "expired.badssl.com" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// SpecialErrorPageUserScript.swift | ||
// DuckDuckGo | ||
// | ||
// Copyright © 2024 DuckDuckGo. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import Foundation | ||
import SpecialErrorPages | ||
import ContentScopeScripts | ||
|
||
extension SpecialErrorPageUserScript { | ||
|
||
static func localeStrings(for languageCode: String = Locale.current.languageCode ?? "en") -> String? { | ||
if let localizedFile = ContentScopeScripts.Bundle.path(forResource: "special-error", | ||
ofType: "json", | ||
inDirectory: "pages/special-error/locales/\(languageCode)") { | ||
return try? String(contentsOfFile: localizedFile) | ||
} | ||
return nil | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.