Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
d8282de2
Commit
d8282de2
authored
Oct 15, 2021
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Respect !tls-no-postpone-early-data with boringssl
parent
3a721a9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
2 deletions
+42
-2
src/shrpx_connection.cc
src/shrpx_connection.cc
+42
-2
No files found.
src/shrpx_connection.cc
View file @
d8282de2
...
...
@@ -397,11 +397,12 @@ int Connection::tls_handshake() {
ERR_clear_error
();
auto
&
tlsconf
=
get_config
()
->
tls
;
#if OPENSSL_1_1_1_API && !defined(OPENSSL_IS_BORINGSSL)
if
(
!
tls
.
server_handshake
||
tls
.
early_data_finish
)
{
rv
=
SSL_do_handshake
(
tls
.
ssl
);
}
else
{
auto
&
tlsconf
=
get_config
()
->
tls
;
for
(;;)
{
size_t
nread
;
...
...
@@ -499,7 +500,12 @@ int Connection::tls_handshake() {
// Don't send handshake data if handshake was completed in OpenSSL
// routine. We have to check HTTP/2 requirement if HTTP/2 was
// negotiated before sending finished message to the peer.
if
(
rv
!=
1
&&
tls
.
wbuf
.
rleft
())
{
if
((
rv
!=
1
#if defined(OPENSSL_IS_BORINGSSL)
||
SSL_in_init
(
tls
.
ssl
)
#endif // defined(OPENSSL_IS_BORINGSSL)
)
&&
tls
.
wbuf
.
rleft
())
{
// First write indicates that resumption stuff has done.
if
(
tls
.
handshake_state
!=
TLSHandshakeState
::
WRITE_STARTED
)
{
tls
.
handshake_state
=
TLSHandshakeState
::
WRITE_STARTED
;
...
...
@@ -535,6 +541,40 @@ int Connection::tls_handshake() {
return
SHRPX_ERR_INPROGRESS
;
}
#if defined(OPENSSL_IS_BORINGSSL)
if
(
!
tlsconf
.
no_postpone_early_data
&&
SSL_in_early_data
(
tls
.
ssl
)
&&
SSL_in_init
(
tls
.
ssl
))
{
auto
nread
=
SSL_read
(
tls
.
ssl
,
buf
.
data
(),
buf
.
size
());
if
(
nread
<=
0
)
{
auto
err
=
SSL_get_error
(
tls
.
ssl
,
nread
);
switch
(
err
)
{
case
SSL_ERROR_WANT_READ
:
case
SSL_ERROR_WANT_WRITE
:
break
;
case
SSL_ERROR_ZERO_RETURN
:
return
SHRPX_ERR_EOF
;
case
SSL_ERROR_SSL
:
if
(
LOG_ENABLED
(
INFO
))
{
LOG
(
INFO
)
<<
"SSL_read: "
<<
ERR_error_string
(
ERR_get_error
(),
nullptr
);
}
return
SHRPX_ERR_NETWORK
;
default:
if
(
LOG_ENABLED
(
INFO
))
{
LOG
(
INFO
)
<<
"SSL_read: SSL_get_error returned "
<<
err
;
}
return
SHRPX_ERR_NETWORK
;
}
}
else
{
tls
.
earlybuf
.
append
(
buf
.
data
(),
nread
);
}
if
(
SSL_in_init
(
tls
.
ssl
))
{
return
SHRPX_ERR_INPROGRESS
;
}
}
#endif // defined(OPENSSL_IS_BORINGSSL)
// Handshake was done
rv
=
check_http2_requirement
();
...
...
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