Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
99d0f8f2
Unverified
Commit
99d0f8f2
authored
Jun 01, 2022
by
Christopher Fujino
Committed by
GitHub
Jun 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] handle HandshakeException in httphostvalidator (#105076)
parent
4e23ed36
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
http_host_validator.dart
packages/flutter_tools/lib/src/http_host_validator.dart
+2
-0
http_host_validator_test.dart
...est/commands.shard/hermetic/http_host_validator_test.dart
+34
-0
No files found.
packages/flutter_tools/lib/src/http_host_validator.dart
View file @
99d0f8f2
...
...
@@ -72,6 +72,8 @@ class HttpHostValidator extends DoctorValidator {
return
_HostValidationResult
.
fail
(
host
,
'An error occurred while checking the HTTP host:
${e.message}
'
);
}
on
HttpException
catch
(
e
)
{
return
_HostValidationResult
.
fail
(
host
,
'An error occurred while checking the HTTP host:
${e.message}
'
);
}
on
HandshakeException
catch
(
e
)
{
return
_HostValidationResult
.
fail
(
host
,
'An error occurred while checking the HTTP host:
${e.message}
'
);
}
on
OSError
catch
(
e
)
{
return
_HostValidationResult
.
fail
(
host
,
'An error occurred while checking the HTTP host:
${e.message}
'
);
}
on
FormatException
catch
(
e
)
{
...
...
packages/flutter_tools/test/commands.shard/hermetic/http_host_validator_test.dart
View file @
99d0f8f2
...
...
@@ -302,6 +302,40 @@ void main() {
});
});
testWithoutContext
(
'Does not throw on HandshakeException'
,
()
async
{
const
String
handshakeMessage
=
'''
Handshake error in client (OS Error:
BLOCK_TYPE_IS_NOT_01(../../third_party/boringssl/src/crypto/fipsmodule/rsa/padding.c:108)
PADDING_CHECK_FAILED(../../third_party/boringssl/src/crypto/fipsmodule/rsa/rsa_impl.c:676)
public key routines(../../third_party/boringssl/src/crypto/x509/a_verify.c:108)
CERTIFICATE_VERIFY_FAILED: certificate signature failure(../../third_party/boringssl/src/ssl/handshake.cc:393))
'''
;
final
HttpHostValidator
httpHostValidator
=
HttpHostValidator
(
platform:
FakePlatform
(
environment:
kTestEnvironment
),
featureFlags:
TestFeatureFlags
(
isAndroidEnabled:
false
),
httpClient:
FakeHttpClient
.
list
(<
FakeRequest
>[
FakeRequest
(
Uri
.
parse
(
kTestEnvPubHost
),
method:
HttpMethod
.
head
,
responseError:
const
HandshakeException
(
handshakeMessage
),
),
FakeRequest
(
Uri
.
parse
(
kTestEnvGCloudHost
),
method:
HttpMethod
.
head
),
]),
);
// Run the validation check and get the results
final
ValidationResult
result
=
await
httpHostValidator
.
validate
();
expect
(
result
.
messages
.
first
,
isA
<
ValidationMessage
>().
having
(
(
ValidationMessage
msg
)
=>
msg
.
message
,
'message'
,
contains
(
handshakeMessage
),
),
);
});
testWithoutContext
(
'Http host validator timeout message includes timeout duration.'
,
()
async
{
final
HttpHostValidator
httpHostValidator
=
HttpHostValidator
(
platform:
FakePlatform
(
environment:
kTestEnvironment
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment