Results 1 to 8 of 8
  1. #1

    Connection Issues (SSL related?) [WinRT]

    Hi all,

    I'm having trouble connecting to a host using the WinRT SDK. It connects fine from the Android client on an emulator on the same machine. However, when connecting from a Win8 emulator, calling client.OpenConnection results in a PushConnException being thrown. The exception only says "Unable to connect to the remote server".

    Everything seems pretty straightforward except possibly the SSL stuff, so my suspicion is that using the self-signed cert might be causing issues in some manner but am having trouble analyzing further from this particular error.

    Some code/settings (replacing actual host path with placeholder value, but real one is still https:

    Code:
    public void Start(string pushServerUrl, int phase, ILightstreamerListener listener) {
                this._started = true;
                FidelityConnectionListener ls = new FidelityConnectionListener(listener, phase);
    
                ConnectionInfo connInfo = new ConnectionInfo();
                connInfo.User = App.user;
                connInfo.Password = App.password;
                connInfo.PushServerUrl = pushServerUrl;
                connInfo.Adapter = App.adapter;
                client.OpenConnection(connInfo, ls);
    
            }
    Code:
    private const string pushServerHost = "https://server1.myhost.com:8443";
    SSL added in app manifest by adding a "Certificates" declaration in Package.appxmanifest and then setting the info for the actual cert to:

    Store Name: CA (also tried root)
    Content: path/to/cert (also tried moving it directly into the project tree and updating the path)

    the pushServerUrl, the user, the password, and the adapter all match the Android version which is working. In addition, the connection attempt is not even appearing in the server logs.

    Any thoughts on what potential root causes might be for this problem?

    Thanks!

  2. #2
    Adding exposed stack trace:

    Code:
       at Lightstreamer.DotNet.Client.ExtConnectionListener.WaitStreamingTimeoutAnswer()
       at Lightstreamer.DotNet.Client.LSClient.OpenConnection(ConnectionInfo info, IConnectionListener listener)
       at Fidelity_Lightstreamer.Source.LightstreamerClient.Start(String pushServerUrl, Int32 phase, ILightstreamerListener listener) in c:\Users\a543617\dev\fidelity-lightstreamer\Fidelity-Lightstreamer\Source\LightstreamerClient.cs:line 44
       at Fidelity_Lightstreamer.App.<Start>d__6.MoveNext() in c:\Users\a543617\dev\fidelity-lightstreamer\Fidelity-Lightstreamer\App.xaml.cs:line 179

  3. #3
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    538
    Hi Eric,

    even if it was a problem related with the SSL certificate is still weird that on the server side the connection attempt does not appear at all.
    So please, can you repeat the test after you have set these options in the configuration file (lightstreamer_log_conf.xml) of the server log:

    Code:
    <logger name="LightstreamerLogger.connections" level="DEBUG"/>
    <logger name="LightstreamerLogger.connections.ssl" level="DEBUG"/>
    Please also, can you confirm us that you are testing with Windows 8 or 8.1?

    Thank you,
    Giuseppe

  4. #4
    I don't have access to the server side configuration settings at the moment, but I believe it is set to debug as we have received verbose logs for connection attempts on Android. We'll double-check tomorrow when our contact returns, but I'm pretty sure it is already set.

    We are testing on Windows 8. Any other thoughts as to what might be happening?

    Thanks!

  5. #5
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    538
    Hi Eric,

    If the connections and connections.ssl loggers (at DEBUG level) do not report anything about the attempt of connection from your WinRT client then most likely the issue is happening before than the SSL is involved.
    Indeed, from our experience, in cases of issues with recognition of self-signed certificates the server log always reported a message about the problem.

    Anyway, please check these few links about WinRT self-signed certificate issues:


    http://stackoverflow.com/questions/1...es-using-winrt
    http://stackoverflow.com/questions/1...ith-httpclient

  6. #6
    The server logs do not show anything with debug mode turned on. We also timed the failure, and it seems to be happening around 1100 ms, which would suggest maybe that the attempt is timing out in the WaitOne() method?

    Turning on an internal network listener, there is a dns request that happens for the domain and the app gets the successful response for that but then there doesn't appear to be any request to that actual ip address.

    We also tried this on a Windows 8.1 Surface with the same result.

    Any other ideas/suggestions?

    Thanks!

  7. #7
    Okay, made it past the first issue. Same network, but their might be some network segregation going on. Adding the proxy to the computer made it so the client will now find/connect successfully. However, the connection closes after ~30 seconds with a PushConnException:

    {"The underlying connection was closed: The connection was closed unexpectedly."} Lightstreamer.DotNet.Client.PushConnException


    On the server, they saw the SSL handshake succeed but and then the connection closed shortly after that.

    debug logs:

    23-Jan-14 16:08:25,364|DEBUG|LightstreamerLogger.connections | Lightstreamer HTTPS Server|Socket accept on 10.x.x.20:58596
    23-Jan-14 16:08:25,424|DEBUG|ghtstreamerLogger.connections.s sl|IO SSL HANDSHAKE SELECTOR 1|Handshake completed on socket Lightstreamer HTTPS Server; selected cipher suite TLS_RSA_WITH_AES_128_CBC_SHA
    23-Jan-14 16:08:25,424|INFO |LightstreamerLogger.connections |SERVER POOLED THREAD 5 |Accepted HTTPS connection on Lightstreamer HTTPS Server from 10.x.x.20:58596
    23-Jan-14 16:08:30,236|DEBUG|LightstreamerLogger.connections | Lightstreamer HTTPS Server|Socket accept on 10.x.x.20:60089
    23-Jan-14 16:08:30,380|DEBUG|ghtstreamerLogger.connections.s sl|IO SSL HANDSHAKE SELECTOR 1|Handshake completed on socket Lightstreamer HTTPS Server; selected cipher suite TLS_RSA_WITH_AES_128_CBC_SHA
    23-Jan-14 16:08:30,380|INFO |LightstreamerLogger.connections |SERVER POOLED THREAD 6 |Accepted HTTPS connection on Lightstreamer HTTPS Server from 10.x.x.20:60089
    23-Jan-14 16:08:46,305|INFO |LightstreamerLogger.connections |SERVER POOLED THREAD 1 |Closed HTTPS connection on Lightstreamer HTTPS Server from 10.x.x.20:58596
    23-Jan-14 16:08:56,376|INFO |LightstreamerLogger.connections |SERVER POOLED THREAD 8 |Closed HTTPS connection on Lightstreamer HTTPS Server from 10.x.x.20:60089


    (slight ip address obfuscation, even tho it is private)

    Also, when i look for all exceptions there is a socketException that is being thrown: System.net.Sockets.SocketError.AccessDenied
    message: An attempt was made to access a socket in a way forbidden by its accessor permissions

    Any suggestions on next steps?

  8. #8
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    538
    Hi Eric,

    The unexpected closures are due to normal behavior of the server that after a certain period of inactivity closes the connection.
    Thus, it is possible that the two connections shown in the log have been opened but then never used?

    I don't think that the "AceessDenied" exception is directly linked to the situation seen above; perhaps it can cause a blockage in the logic flow of the application and thus prevent subsequent requests to Lightstreamer?
    By the way, the problem of "AccessDenied" should be linked to problems of permissions configuration in the client application.

 

 

Similar Threads

  1. Mixing SSL and non-SSL
    By kpturner in forum General
    Replies: 2
    Last Post: March 2nd, 2015, 10:19 AM
  2. Lightstreamer WinRT Client Lib is Available
    By Alessandro in forum Client APIs
    Replies: 0
    Last Post: December 20th, 2012, 11:04 AM
  3. create_session related issue.
    By Sathyaayyanar in forum Adapter APIs
    Replies: 5
    Last Post: August 24th, 2010, 09:32 AM
  4. SetDomain setLSHost related issue
    By Sathyaayyanar in forum Client APIs
    Replies: 1
    Last Post: July 30th, 2010, 01:32 PM
  5. Trying to run LS through Https / SSL
    By wmolde in forum Client APIs
    Replies: 2
    Last Post: April 18th, 2007, 03:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 11:17 PM.