Problem with self host Server - Client on Mac (Mono) #1999

Closed
mindobjects opened this Issue May 7, 2013 · 2 comments

Comments

Projects
None yet
3 participants
@mindobjects

Environment : Mac OS 10.8.3, Mono Mac 3.0.10.
Self Host is run on Mac.

With version 1.1 :

  1. Compile SignalR -> OK
  2. Compile and launch Server (Self host mode) -> OK
  3. Compile and launch Client that connect to the Self host mode -> KO (Problem occured when : hubConnection.Start().Wait(); and error is
    Unhandled Exception:
    System.NotImplementedException: The requested feature is not implemented.
    at System.Net.HttpWebRequest.set_ClientCertificates (System.Security.Cryptography.X509Certificates.X509CertificateCollection value) [0x00000] in :0
    at (wrapper remoting-invoke-with-check) System.Net.HttpWebRequest:set_ClientCertificates (System.Security.Cryptography.X509Certificates.X509CertificateCollection)

Normal since Mono don't implement : ClientCertificates

With latest dev version (07-05-2013) :

  1. Compile SignalR -> OK
  2. Compile and launch Server (Self host mode) -> OK
  3. Compile and launch Client that connect to the Self host mode -> KO (Problem occured when : hubConnection.Start().Wait(); and error is
    Unhandled Exception:
    System.AggregateException: One or more errors occured ---> System.AggregateException: One or more errors occured ---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error.

If I used URL : http://127.0.0.1:8089/signalr/negotiate I get following response :
{"Url":"/signalr","ConnectionToken":"RnOQG/AArNoQo58gBTaeYXXKrMfNFyo4I1LPLrIlFmZaUFUZYubkyn5HIVxSp9N/SXz96Yd/eREutsvib9EZSxlOiTAwR4WFW4EN5efsDCJyqyI9xCubH/spK1ndoPlnF/SX1FfhDIxon/oHZJYvhvJl4JzDye9HmNXvvJ7ZmZLWIyEup2+86+4lti1TXsSksNnQ098l0dnrSZfmNGzoyeenjg3H/fC3+JG25xYhrlhU0pp81eCCLy1gw+WLafiqFjj4YQQy0eps45+4sbHY7kZpwwGtsxnXq5bh7a7yIZLV0oE35E38sOJlX7nX5ZUZ","ConnectionId":"8986ecdf-484d-4553-8233-1a728b3c75e7","KeepAliveTimeout":20.0,"DisconnectTimeout":30.0,"TryWebSockets":false,"WebSocketServerUrl":null,"ProtocolVersion":"1.2"}

Client code :
namespace SignalR.SelfHost.DotNetClient
{
class Program
{
static void Main(string[] args)
{

        var hubConnection = new HubConnection("http://127.0.0.1:8089/");
        var serverHub = hubConnection.CreateHubProxy("MessageRecievingHub");
        serverHub.On("broadCastToClients", message => System.Console.WriteLine(message)); // 
        hubConnection.Start().Wait();
        string line = null;
        while ((line = System.Console.ReadLine()) != null)
        {
            // Send a message to the server
            serverHub.Invoke("SendMessage", line).Wait();
        }

        System.Console.Read();
    }
}

}

Server code :

namespace SignalR.SelfHost.Server
{
public class Program
{
static void Main(string[] args)
{
using (WebApplication.Start("http://127.0.0.1:8089/"))
{
Console.WriteLine("Server running at http://127.0.0.1:8089/");
Console.ReadLine();
}
}
}
}

@gustavo-armenta

This comment has been minimized.

Show comment Hide comment
@gustavo-armenta

gustavo-armenta May 13, 2013

Contributor

use Fiddler or this code to see the http response content

            try
            {
                hubConnection.Start().Wait();
            }
            catch (Exception e)
            {
                var webException = e.InnerException as WebException;
                if(webException != null)
                {
                    var stream = webException.Response.GetResponseStream();
                    var reader = new StreamReader(stream);
                    Console.WriteLine(reader.ReadToEnd());
                }
            }
Contributor

gustavo-armenta commented May 13, 2013

use Fiddler or this code to see the http response content

            try
            {
                hubConnection.Start().Wait();
            }
            catch (Exception e)
            {
                var webException = e.InnerException as WebException;
                if(webException != null)
                {
                    var stream = webException.Response.GetResponseStream();
                    var reader = new StreamReader(stream);
                    Console.WriteLine(reader.ReadToEnd());
                }
            }
@davidfowl

This comment has been minimized.

Show comment Hide comment
@davidfowl

davidfowl May 22, 2013

Owner

Fixed in dev 57e1c98 and cede520

Owner

davidfowl commented May 22, 2013

Fixed in dev 57e1c98 and cede520

@davidfowl davidfowl closed this May 22, 2013

@ghost ghost assigned gustavo-armenta May 31, 2013

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