FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Clear certificate chain in setKeyMaterial. by mawiwill · Pull Request #987 · netty/netty-tcnative · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
19 changes: 19 additions & 0 deletions openssl-dynamic/src/main/c/ssl.c
This file contains hidden or 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
Expand Up @@ -2316,6 +2316,25 @@ TCN_IMPLEMENT_CALL(void, SSL, setKeyMaterial)(TCN_STDARGS, jlong ssl, jlong chai
}
}

#if OPENSSL_VERSION_NUMBER >= 0x10002000L
// Clear the chain; the loop below appends certificates to the
// chain, and in TLS 1.3, this can be called again after the
// server sends a HelloRetryRequest. Without clearing the
// certificate chain that results in duplicate entries.
if (SSL_clear_chain_certs(ssl_) != 1) {
Comment thread
normanmaurer marked this conversation as resolved.
Resolved
int errCode = ERR_get_error();
if (errCode == 0) {
tcn_Throw(e, "Could not clear certificate chain (unknown)");
} else {
ERR_error_string_n(errCode, err, ERR_LEN);
ERR_clear_error();

tcn_Throw(e, "Could not clear certificate chain (%s)", err);
}
return;
}
#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L

Comment thread
normanmaurer marked this conversation as resolved.
Resolved
// The first cert was loaded via SSL_use_certificate so skip it.
for (i = 1; i < numCerts; ++i) {

Expand Down
Loading

Back | FazBrowse Home | New Git URL