I am trying to configure the website SSL port with the certificate for a website within IIS 6.0 programmatically.
IIS 7.0 provides the API, ServerManager, to do so, but I am not sure if there is something similar for IIS 6.0 or command line utilities.
Thanks in advance!
If you mean just setting the port NUMBER programmatically, you can use the metabase command line tool (by default in C:\Inetpub\AdminScripts):
cscript adsutil.vbs set w3svc/1/securebindings ":nnn:"
where nnn is the port number (e.g., ":443:"). (If you have more than one site on the server, you will need to substitute w3svc/x/securebindings, where x is the web site ID.)
If you actually need to install the CERTIFICATE programmatically, from what I gather there's a script in the IIS 6.0 Resource Kit to do it (IISCertDeploy.vbs) but I've not tried it.
Related
I'm using the preview tooling for ASP.NET Core and VS 2015 that was released in Dec timeframe.
I've followed numerous online examples with how to enable SSL in Kestrel. None of them worked.
So I tried an option in project called "Enable SSL" and it seems to set a port for me, and works from local host, but doesn't seem to work from elsewhere.
I've also tried .UseKestrel() I have option.UseHttps("ssl.pfx", "password")
Below that I have UseUrls, but it doesn't seem to bind correctly to the ports because my SSL requests. When I try to issue SSL requests it times out. I used netstat and it seems like there is no port opened for my specified SSL port.
1) How do I use UseUrls? I need both localhost and remote machine access
2) How do I configure IIS express to allow the https calls?
If anyone has a good reliable way to set this up for VS 2015 in an ASP.NET Core project I would really appreciate it!
Thanks,
James
You're not saying what you have tried so far, so maybe you've tried that already, but you need to:
have a valid certificate that your server will be able to provide to the client
install the nuget package: Microsoft.AspNetCore.Server.Kestrel.Https
change your configure sequence so that it uses Kestrel Https
app.UseKestrelHttps(certificate);
change the url Kestrel is listening to one starting by https://
I used this article a few months back on VS2015: https://www.thesslstore.com/blog/implement-ssl-kestrel-asp-net-core/
I worked fine for me, but maybe there are a few things to adapt with the latest version.
I have an MVC 3 application and WCF service to be deployed in IIS 8.5 installed on Windows Server. I have checked all the prerequisites installed for IIS 8.5. After the deployment when I try to access the .svc files, I get "This page can't be displayed".
The have verified the below conditions.
APP POOL:
1.) The app pool is set to "Integrated" mode and targetted to V4.0.
2.) Identity is set to "ApplicationPoolIdentity" and enabled 32 bit
applications.
BINDINGS:
1.) Provided a different port"88" and ip address is configured.
PERMISSIONS:
1.) Full access has been provided for the below mentioned users.
a.) IUSR
b.) IIS_IUSRS
c.) DefaultAppPool(This is the app pool that has
been assigned).
I am struck with this, Please let me know for anything that needs to be included.
Do you have HTTP Activation checked for WCF Service under IIS features. If not you need to enable that from server manager add roles/features wizard. Please refer to the image attached.
I have WCf service hosted in windows service.
I would want to know how would i make service accessible only through SSL and use certificate provided by certificate issuer(Godaddy,verisign etc).
If you created a WCF-Service you'll be forced to use an Windows IIS Server to host your application. When using an IIS, you can specify the Port and an SSL-Certificate.
To do this, just
add a new Website to your IIS. Make sure, you are using an application pool that supports .NET Framework 4.0.
copy your compiled WCF-Service and all references/files that your services needs to the associated IIS-Site-Folder
Configure the Bindings of this IIS Page. You need an imported SSL-Certificate at this point. If you already imported it, you can choose it from a ListBox within the Bindings-Dialog.
Within that dialog, you can specify the port
Make sure you've opened that port on your firewall
If you delete other bindings (meaning all HTTP Bindings), you can make sure that your service is only reachable through SSL and your specific port.
If you need cheap, good and multidomain/wildcard certificates, please check out StartSSL. In my opinion, they serve you the best.
You can find more information about IIS Configuration here.
I cannot access my WCF service in IIS 6.0 when running on a VM (Windows 2003 64 bit server).I have a local IIS as well on where I developed the service, and I can access my service fine over there. I built a deployment package and deployed it to the VM, however I just cannot get to it.
Particulars about the WCF service:
1 - Its REST based
2 - Using SSL
If I place a static HTML file in the directory where my service.svc file is, I am able to access that but I cannot access the service.svc file. I am doing all this using IE.
So for instance
Any help would be appreciated it. Thanks.
Couple of things to check:
ASP.NET is installed properly and is registered for IIS (aspnet_regiis -i). Best way is not to use a static file, but an .aspx file to see if the asp.net runtime is running.
Verify you are running a 64-bit binary for the wcf service. If you copied if from a local 32-bit OS, you might need to recompile it for 64-bit.
Did you use https localy also? if not, try to change the configuration of the service to use http (without ssl), check that it works, and then understand what is the required configuration for https.
When one develops a self-hosted WCF http server,
one of the steps needed is to bind an SSL certificate to a port number:
httpcfg set ssl -i 0.0.0.0:8012 -h 0000000000003ed9cd0c315bbb6dc1c08da5e6
as stated in:
http://msdn.microsoft.com/en-us/library/ms733791.aspx
However,
It is hardly expected that in my deployment environment one would be able to do it.
(I don't even know if the httpcfg.exe is redistributable)
Moreover, if the user changed the port after he installed the product then he will need to run the command again....
how can this step be automated pro grammatically?
preferably in C# but if it can only be done in C++ (direct access to the Http Server API)
then I will manage :)
Have a look here: an open source C# UI for configuring HTTP.SYS that directly drives the API. This should get you an idea of the code necessary for configuring the certs.
For those tuning in a couple of years later:
This article from Mike Bouck's RAM has a clean C# wrapper for the http.sys api.
Таке а look on https://github.com/segor/SslCertBinding.Net
It also has nuget available
Install-Package SslCertBinding.Net
and does what you need perfectly. Thanks to the author.