EldoS | Feel safer!

Software components for data protection, secure storage and transfer

TElHTTPSClient - .Net - WebTunneling - socket state 0?

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
Posted: 12/06/2013 13:16:46
by Dragan Juric (Basic support level)
Joined: 12/06/2013
Posts: 4


I'm trying to make a Windows Phone app, which needs to connect to a server behind a tunnel. I can connect to servers that are directly exposed, but with tunneling, I get an error.

The code:
            TElHTTPSClient client = new TElHTTPSClient();
            client.SSLEnabled = _useSSL;
            client.OnReceivingHeaders += new SBHTTPSClient.TSBHTTPHeadersEvent(SecureClient_OnReceivingHeaders);
            client.OnDocumentBegin += new SBUtils.TNotifyEvent(SecureClient_OnDocumentBegin);
            client.OnCloseConnection += new SBSSLClient.TSBCloseConnectionEvent(SecureClient_OnCloseConnection);
            client.OnDocumentEnd += new SBUtils.TNotifyEvent(SecureClient_OnDocumentEnd);
            client.OnData += new SBSSLCommon.TSBDataEvent(SecureClient_OnData);
            client.OnCertificateValidate += new SBSSLCommon.TSBCertificateValidateEvent(SecureClient_OnCertificateValidate);

            client.OnCertificateNeededEx += new SBSSLClient.TSBCertificateNeededExEvent(SecureClient_OnCertificateNeededEx);

            // tunneling
            client.UseWebTunneling = true;
            client.WebTunnelAddress = _host;
            client.WebTunnelPort = _port;
            client.WebTunnelRequestHeaders.Add("Tenant-Id", "rimtest0152");
            client.WebTunnelRequestHeaders.Add("Origin-Server-Id", "bdmi");

            int err = 0;

            //string url = _host + "/" + request;
                //err = client.Head("/mdm");
                err = client.Options("/mdm");

The problem:
Everything works until after the point where the tunneling options are set.
On any call after those lines - such as client.Options() in this case - I get a SBSocket.EElSocketError: Wrong socket state 0 in CanReceive (error code is 96258)
at SBSocket.TElSocket.CanReceive(Int32 WaitTime)
at SBHTTPSClient.TElHTTPSClient.PerformExchange()
at SBHTTPSClient.TElHTTPSClient.PerformRequest(Int32 Method, String URL)
at SBHTTPSClient.TElHTTPSClient.Options(String URL)
at BDMISecureBlackBox.Connection.SimpleRequest1(String request)} System.Exception {SBSocket.EElSocketError}

Am I missing something? I'm sort of new to SSL and tunneling, learning as I go, any advices will be appreciated.
Posted: 12/06/2013 13:21:20
by Eugene Mayevski (EldoS Corp.)

The question requires deeper investigation so I am moving it to HelpDesk.

Sincerely yours
Eugene Mayevski



Topic viewed 902 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!