Microsoft.WebSockets WebSocketHandler Secure SSL - asp.net-mvc

I created an MVC web application and embedded an WebSockets chat server. I can deploy this app to an secure endpoint, but how can I get the WebSocketHandler to listen to a wss:// endpoint?

If your web app has a HTTPS binding, WSS should be able of connecting. Check your IIS configuration, enable the port TCP 443 with HTTPS binding and a certificate in the bindings configuration.
Now if you access the web app through HTTPS, you should connect via WSS without problems.
If you access via HTTP, the certificate is self signed, and you didn't accept it in the browser before, it will probably fail. Watch out with that.

Related

https SSL for IP address?

I have HTTP requests in my iOS app to a simple NODE.js app on my server. Since iOS has App Transport Security, I wondered how I could simply add a self-signed SSL certification to my IP address then I wouldn't have to worry about bypassing ATS. It would just look like
https://192.0.2.12/API
Is there a simple way to do it on an Ubuntu server?

Enabling https protocol in .NET MVC 5 application for localhost

I'm trying to enable https protcol for my application that I'm building on a localhost which has a port number like this:
https://localhost:19590/
I have went to the IIS xx express version and enabled https binding and have been able to access localhost (without any port number) via https like this:
https://localhost/
But now I need to enable HTTPS for the project solution I'm working on currently on port 19590, and when I try to access it, it says that the:
This site can’t provide a secure connection
What am I doing wrong here, how can I enable HTTPS for the localhost project on this port number exactly?
In your project properties, in the web section under Servers can you try choosing Local IIS instead of IIS Express and create virtual directory on https://localhost/

Accessing local https site over LAN

I am trying to debug my ASP.Net MVC website when hosted over https. I am hosting this via the IIS instance with Visual Studio. I need to access the website from a mobile device - so I am attempting to access the site via LAN.
I have enabled https via visual studio by going to the project properties and setting SSL Enabled to true. Now, when I debug the site, it starts two local instances; one for http (as usual) and one for https. The internal ports for these are listed when I right click the IIS icon in the task tray.
I do not have an SSL certificate installed. My browser gives me insecure connection warnings, but I just dismiss them - I don't believe these are a concern as I am just testing locally (I could be wrong).
I am using a program called Sharp Proxy to translate these internal ports to external ones, allowing my site to be accessible. 64312 is my internal port for accessing the site over http. Sharp proxy is translating this to 4567. 44300 is my internal port for accessing the site over https. Sharp proxy is translating this to 5678.
Successful permutations:
http://localhost:64312 - SUCCESS
https://localhost:44300 - SUCCESS
http://192.168.0.72:4567 - SUCCESS
Failed permutations:
https://192.168.0.72:5678 - FAIL
Bad Request - Invalid Hostname
The issue is clearly not to do with accessing my machine over LAN as I am able to successfully hit 192.168.0.72 with http.
My question is: What do I need to do to be able to access my https site over LAN via debugging with Visual Studio?
In order to verify the identity of the server you're connecting to, HTTPS needs a hostname to check the certificate against.
Therefore, you cannot connect to an IP address over HTTPS.
You need to use a domain name.

Spring Security, OpenID, and mod_proxy

I have an application using spring-security's OpenID implementation. The app server sits behind a proxy. The proxy is apache httpd with mod_proxy. If the proxy connects to the app server via HTTP, the application will tell the OpenID authenticator to redirect back via HTTP rather than HTTPS like I would prefer. It seems to pull the protocol dynamically and only sees HTTP. If I configure the proxy to use HTTPS, I run into this problem. So is there a way to operate spring security behind a proxy which uses HTTP?
A little extra mod_proxy and Glassfish configuration solved this problem for me:
https://serverfault.com/questions/496888/ssl-issue-with-mod-proxy

google OAuth for service on unusual port

I have running my own website for security reasons at an unusual port: https on Port 11223 instead oh 443.
This website provides the feature to login with an google account, realized by using the google OAuth API.
At the last step of authentication (redirecting back from google OAuth to my system), an network timeout happens.
On the other hand: if my server is running https on default port 443 instead of 11223, everything works fine.
I have configured the google OAuth client settings (Redirect URIs, Home page URL, JavaScript origins) for using the special port 112233. But without success.
Maybe it's important to know, the Server is behind a firewall with NAT. This means, the firewall receives https connections to port 11223 to redirect this to the internal webserver running https only on port 11223. But I think, this is not the point.
What could be the reason, why port 443 works but port 11223 doesn't.
I guess google OAuth does not support webservers running on an unusual prot!?!
The port number is 16 bits and thus can not exceed 65535.
Could it be proxy configuration issues? I recommend you configure your firewall to return 404 on the port 11223 and see what happens.

Resources