How do you bind the hostname?
In short: I need this for a selfhosted website without iis:
I have found how to bind the certificate, but not how to bind the hostname.
netsh.exe http add sslcert ipport=0.0.0.0:82 certstorename=Root certhash=... appid={12345678-db90-4b66-8b01-88f7af2e36bf}
use netsh http add sslcert hostnameport="yoursite.com:443" ...
as described here https://weblog.west-wind.com/posts/2016/Jun/23/Use-Powershell-to-bind-SSL-Certificates-to-an-IIS-Host-Header-Site
Related
I lauched docker container using Rancher 2 and when i click on its URL it takes me to http://xx.xxx.xxx.xx:32000
But i would like is : it takes me to directly to https://xx.xxx.xxx.xx:32000 (https instead of http).
How can i do that ?
Any help would appriciated!
Since I see 32000 in the URL, I am assuming you had used NodePort to expose your application. If you are using Rancher 2.x, you would be able to take advantage of Ingress. You can expose your app using port 433 by providing your SSL certificates and the ingress controller automatically does the redirect for you. This is similar behavior provided by Load Balancers in various cloud providers.
If you want to do it in your app, you should be able to add logic in your http/https action handler code where you can do a redirect from http to https.
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/
I want to use the Swagger editor to test my REST service deployed with Grizzly.
My service is on a different port (8081) then the Swagger editor (8080).
How can I tell the editor (local or online) to use another port?
Thanks
Found the answer, haven't tested it yet:
Under the swagger object, there's a fixed field called host:
The host (name or ip) serving the API. This MUST be the host only and
does not include the scheme nor sub-paths. It MAY include a port. If
the host is not included, the host serving the documentation is to be
used (including the port). The host does not support path templating.
taken from:
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
Dropbox requires the callback URL to be over HTTPS (when not using localhost).
Using Mule 3.6.0 with the latest dropbox connector, the callback defaults to http - thus only working with localhost. For production I need to use https for the OAuth dance.
What is the correct way to specify a https callback URL?
I've tried:
<https:connector name="connector.http.mule.default">
<https:tls-key-store path="${ssl.certfile}" keyPassword="${ssl.keyPass}" storePassword="${ssl.storePass}"/>
</https:connector>
<dropbox:config name="Dropbox" appKey="${dropbox.appKey}" appSecret="${dropbox.appSecret}" doc:name="Dropbox">
<dropbox:oauth-callback-config domain="production.mydomain.com" path="callback" />
</dropbox:config>
But it errors:
Endpoint scheme must be compatible with the connector scheme. Connector is: "https", endpoint is "http://production.mydomain.com:8052/callback"
Here's what I ended up with that solved the problem:
<https:connector name="connector.http.mule.default" doc:name="HTTP-HTTPS">
<https:tls-key-store path="${ssl.certfile}" keyPassword="${ssl.keyPass}" storePassword="${ssl.storePass}"/>
</https:connector>
<dropbox:config name="Dropbox" appKey="${dropbox.appKey}" appSecret="${dropbox.appSecret}" doc:name="Dropbox">
<dropbox:oauth-callback-config domain="myserver.domain.com" path="callback" connector-ref="connector.http.mule.default" localPort="8052" remotePort="8052"/>
</dropbox:config>
This works great for localhost, but not if you need the callback to go to something other than localhost (e.g. myserver.domain.com)
Reviewing mule.log you can see that the connector binds to localhost (127.0.0.0) despite the config pointing to:
domain="myserver.domain.com"
Log Entry:
INFO ... Attempting to register service with name: Mule.Ops:type=Endpoint,service="DynamicFlow-https://localhost:8052/callback",connector=connector.http.mule.default,name="endpoint.https.localhost.8052.callback"
INFO ... Registered Endpoint Service with name: Mule.Ops:type=Endpoint,service="DynamicFlow-https://localhost:8052/callback",connector=connector.http.mule.default,name="endpoint.https.localhost.8052.callback"
INFO ... Registered Connector Service with name Mule.Ops:type=Connector,name="connector.http.mule.default.1"
The workaround is to force Mule to listen to 0.0.0.0 for connectors which define localhost as the endpoint.
In wrapper.conf set
wrapper.java.additional.x=-Dmule.tcp.bindlocalhosttoalllocalinterfaces=TRUE
Using the [RequireHttps] port in an ASP.NET MVC application causes a redirect to HTTPS on port 443 if the user attempts to access the application over HTTP.
However, in IIS Express, the application will probably not running on port 443. It will, instead, be running on something like port 44301.
I've found various tips for replacing RequireHttpsAttribute with an implementation that takes the alternative port number as a parameter, or reads it from Web.config.
This is clunky, because it requires configuration in more than one place.
Is there any way to do this -- programmatically -- in a generic fashion?
Without trying to pre-empt the answers, some options occur to me:
Is there any way to discover the bindings being used by the instance of IIS or IIS Express that's hosting my app?
Is there any way to read applicationHost.config for the current IIS / IIS Express host?
You can check currently used bindings (of IIS/IIS Express) by running following command
"netsh http show servicestate view=requestq"
You can find applicationhost.config file of IIS Express in %userprofile%\documents\iisexpress\config folder.