Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSLSocket: remove unnecessary connect() override, log and close socket on doHandshake SSLException #234

Merged
merged 3 commits into from
Nov 21, 2024

Conversation

cconlon
Copy link
Member

@cconlon cconlon commented Nov 18, 2024

This PR includes 2 code changes:

  • Removes unnecessary override to Socket.connect(SocketAddress endpoint). WolfSSLSocket extends Socket, and the super connect(SocketAddress endpoint) calls the existing override with timeout (connect(SocketAddress endpoint, int timeout). With this change, connect() in our code will only be called once, not twice.
  • In WolfSSLSocket.startHandshake(), when doHandshake() fails with a SSLException, we now log the error code, and close the Socket before throwing the exception back up to the caller.

These changes originated from user log analysis.

This also includes one change to the example Android Studio CMakeLists.txt, which was caught by PRB testing on this PR:

  • Define WOLFSSL_CERT_REQ in CMakeLists.txt, needed for use of wolfSSL_X509_REQ_set_version(). When using ./configure --enable-jni, this is already added by configure.ac.

@cconlon cconlon self-assigned this Nov 18, 2024
@JacobBarthelmeh JacobBarthelmeh merged commit fd51ab9 into wolfSSL:master Nov 21, 2024
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants