question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Engine socket fails for createSocket()

See original GitHub issue

This works without setUseEngineSocketByDefault(true)

import java.io.IOException;
import java.net.Socket;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import javax.net.ssl.SSLContext;
import org.conscrypt.Conscrypt;
import org.conscrypt.OpenSSLProvider;

public class MainXX {
  public static void main(String[] args)
      throws NoSuchAlgorithmException, IOException, KeyManagementException {
    Conscrypt.SocketFactories.setUseEngineSocketByDefault(true);
    
    SSLContext sslContext = SSLContext.getInstance("TLS", new OpenSSLProvider());
    sslContext.init(null, null, null);

    Socket socket = sslContext.getSocketFactory().createSocket();
  }
}

Exception in thread "main" java.net.SocketException: Socket is not connected.
	at org.conscrypt.OpenSSLSocketImplWrapper.<init>(OpenSSLSocketImplWrapper.java:37)
	at org.conscrypt.OpenSSLEngineSocketImpl.<init>(OpenSSLEngineSocketImpl.java:80)
	at org.conscrypt.OpenSSLEngineSocketImpl.<init>(OpenSSLEngineSocketImpl.java:54)
	at org.conscrypt.OpenSSLSocketFactoryImpl.createSocket(OpenSSLSocketFactoryImpl.java:84)
	at okhttp3.MainXX.main(MainXX.java:19)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nmittlercommented, May 31, 2017

@yschimke still targeting 1.0.0.

0reactions
yschimkecommented, Jun 7, 2017

working with latest master

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I diagnose "unable to create socket"? - Stack Overflow
Here's how to fix the problem: Chose the 32-bit version of R. Selecting the 32-bit version solves it! RStudio is SO great, it...
Read more >
problem with SSL socket(SSLSocketFactoryImpl.createSocket())
Hello, I'm trying to create a ssl socket but I get an exception, I really don't know why. I have alredy include the...
Read more >
unable to create socket | SAP Community
Hello,. I have idoc to soap scenario. When the message is trying to send, the soap receiver is throwing below error, kindly advice....
Read more >
How to receive error on TCP socket? - Unreal Engine Forums
I have tcp client socket created by FSocket* Socket = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->CreateSocket(NAME_Stream, ListenName, ...
Read more >
SSLSocket via another SSLSocket not working #104 - GitHub
When creating an SSLSocket over an existing SSLSocket via SSLSocketFactory.createSocket() , the call to SSLSocket.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found