c# - SignalR not able to Authentication with Certificate -
i have read links refered non of them solve specific problem have.
the issue not authentication in general, adding client certificate on client side , getting certificate on signalr server. far, not manage make work, there either server error or certificate on server null. if have working sample add client certificate on client side , getting on server, appreciate if send me that.
**on client side have**: connection = new hubconnection(serveruri); var certificate = new x509certificate2(path); connection.addclientcertificate(certificate); hubproxy = connection.createhubproxy("myhub"); ***on server have config:*** <location path="signalr"> <system.webserver> <security> <access sslflags="sslnegotiatecert" /> </security> </system.webserver> </location> ***and certificate tried in hub*** public override bool authorizehubconnection(hubdescriptor hubdescriptor, irequest request) { object cert = null; if (!request.environment.trygetvalue("ssl.clientcertificate", out cert) || !(cert x509certificate)) { return false; } else { return true; } }
doing this, in server when var cert = context.get("ssl.clientcertificate"); null.
Comments
Post a Comment