Skip to content

SSL - Internal error trying to connect to a secure websocket #555

Closed as not planned

Description

@Flix3r

When trying to connect to a secure websocket I get the following output:

Connection error: Unable to connect to server.dev on port 443, error: error in handshake : SSL - Internal error (eg, unexpected failure in lower-level module)

Here is my code:

    ix::initNetSystem();
    webSocket.setUrl("wss://server.dev/ws");
    
    ix::SocketTLSOptions tlsOptions;
    tlsOptions.caFile = "C:/path/to/cacert.pem";
    webSocket.setTLSOptions(tlsOptions);
    std::cout << "Connecting websocket..." << std::endl;


    webSocket.setOnMessageCallback([](const ix::WebSocketMessagePtr& msg)
        {
            if (msg->type == ix::WebSocketMessageType::Message)
            {
                std::cout << "Received message: " << msg->str << std::endl;
            }
            else if (msg->type == ix::WebSocketMessageType::Open)
            {
                std::cout << "Connected successfully" << std::endl;
            }
            else if (msg->type == ix::WebSocketMessageType::Error)
            {
                std::cout << "Connection error: " << msg->errorInfo.reason << std::endl;
            }
        }
    );

    webSocket.start();

Activity

  1. bsergean commented on Nov 17, 2026

    @bsergean
    Collaborator

    I revisited this while working through the open TLS reports. Current client/server tests pass with Mbed TLS 3 and 4 and OpenSSL 1.1/3.6. We have also fixed PSA-state lifetime (#613), terminal read/error handling (#650), and handshake busy-spinning (#655).

    SSL - Internal error does not identify which operation failed, and server.dev in the snippet does not provide a usable reproduction. Could you try current master and provide the IXWebSocket/TLS backend versions, the complete current error, and a minimal server configuration or reproducible endpoint? Your use of caFile for the trust bundle is the correct configuration field.

    Keeping this open pending a current reproduction rather than assuming the other TLS fixes explain this particular failure.

  2. bsergean commented on Nov 17, 2026

    @bsergean
    Collaborator

    Closing this old report because we do not have a usable reproduction or enough information to identify a remaining library defect. The current TLS paths have received several fixes and pass the backend tests described above. This does not establish that the original failure was fixed. Please reopen with a minimal reproduction on current master, backend/version details, and the complete error if it still occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions