Windows Azure Web Role Certificate Error - azure

I need to create a Web Role in Azure with an https endpoint with a real SSL certificate (not self-signed). So I need my own domain, which I have, and have pointed it at my "me.cloudapp.net" URL via a CNAME in my hoster's DNS.
I have purchased a certificate for that domain also. I need to upload that into my Azure portal for the web role, but I can't - Azure gives me an error when I try.
The certificate came in the form of 2 zip files (I'm new to buying certs). One zip has 3 .crt files, and the other has 1 .cer file. Azure requires a .cer or .pfx, so I tried the .cer. It fails with the error "The certificate is not valid, or the password is incorrect."
There is a .crt file in the zip folder that has 3 files that has the same name as the .cer file. If I change the extension of this .crt file to .cer, it will upload, but when I try to publish my deployment, I get the error
"Certificate with thumbprint 3329398FB72BFCC7EF89C90B950D722C6047C2A1 associated with HTTPS input endpoint EndpointForThat does not contain private key. The long running operation tracking ID was: 010a29856c1948f39e71620446223b4e.".

You have to first complete the certificate request process on the machine from which you initiated the request. The process for doing this varies by technology stack. Here is a page from Comodo on how to install certificates on various platforms.
After you have completed the request on the machine that initiated it, then you can export the certificate. That new file is what you need to upload to Azure.

For HTTPS endpoint you need to upload a PFX file.
PFX file is combination of Private Key + Public key.
What you have now is
.cer - public key
.crt - private key
You need to combine the .crt file that matches the name of .cer file into a single .pxf file.
Check this SO question and its answers to get it done.

Related

Azure SSL Binding Issue- No match seleted hostname

I bougth a SSL certificate online from a seller today for my custom domain which redirected to the azure web application with cname.
I did created csr file with that domain let's call it app3.product.com by using IIS 8.And then created the .crt filel with that csr file.
After that i did found that i need the pfx file but i didn't have .key file so, i converted the .crt to .cer than uploaded it by azure portal.
The problem is Azure portal says,
No certificates match the selected hostname
Althogh my certificate issued as app3.product.com and the host name has the same domain name. It doesn't work.
I didn't include key file while i am creating the csr file also the subject of the certificate has some additional information by the issuer. The subject like app3.product.com, Certificate Issued By ... These may be the source of the issue.
Thank you in advance.
You need to include the private key. Otherwise your web server can not decrypt the data the clients (web browsers) are sending to it.
Explanation:
HTTPS/TLS/SSL are based on asymmetric cryptography which means that data gets encrypted with a so-called public key and can only be decrypted with the corresponding private key.
This means that your web server will send a certificate to the browsers which contains the domain name + the public key + a signature from a Certificate Authority (CA). The web browser then checks then if this certificate is valid (with a CA certificate) and uses the included public key to encrypt further data. Since your web server is the only one who knows the private key it can use it to decrypt the web browsers request. Actually the overall process is even a little bit more complex. You might want to have a look at the TLS handshake protocol to see how it works.

How to make you web application in Azure be accessible through https?

I applied for certificates for my domains. I received files with the following extensions:
ca-bundle
crt (multiple files)
p7b
I would like to upload SSL certificates to Azure by installing the certificate. For that I need to upload pfx file that is not included. I read that I need to create a private key and then merge the certificates somehow in order to create one. Unfortunately, as a programmer, I do not understand what and where should be done. Could someone help?
I think, this link here talks about the exact scenario you are talking about.
"The question is, how do I convert the CRT file into a PFX file so that I can upload it to my Azure Web App? Here are the steps I followed to convert a CRT into a PFX file:"
Open Certificate Manager for the Local Computer
Import the Intermediate Certificate (.P7B file)
Import the SSL certificate (.CRT file)
Export the SSL certificate and its dependencies as a .PFX file
https://blogs.msdn.microsoft.com/waws/2015/12/02/add-an-ssl-certificate-to-an-azure-web-app-crt-and-p7b/
You will need to convert it using a Windows system.
More info can be found here
In the end I managed to do it in the following way:
I downloaded openssl from here: https://indy.fulgan.com/SSL/
Two files are needed - the domain certificate and the private key. Once you have them you issue the following command:
openssl pkcs12 -export -out file.pfx -inkey private.key -in certificate.crt
You need to provide a password for the export. This will create a file.pfx file that you can upload to Azure using the same password. The next step is to add SSL bindings. For each domain you choose the certificate and create the binding. After ~2 minutes the https connection will be available for your domains.

Use certificate from ceritifcate store private key, in Azure websites

To use the Azure storage client encryption with a certificate or other encryption/decryption using a certificate one need access to the private key of the certificate.
We use Azure websites/web app (NOT webroles) and want be able to upload a certificate to the certificate store on Azure and access the private key of the certificate.
I'm able to get the certificate from the certificate store, but when I try to access the private key I get key is not exportable.
It possible to upload the file with the code and load the certificate from file, but it would be more convenient and safe to use the certificate store.
Is there a way to do this ?
I have followed this guide: https://azure.microsoft.com/nb-no/blog/using-certificates-in-azure-websites-applications/ but that only give me access to the certificate not the private key.
Make sure that the PFX file that you are uploading to the Azure web app's certificate list in the portal contains the private key in the first place. You can try to import the pfx in your local machine and export it while checking the option "export the private key". If the export the private key option is grayed while doing the export then it means the pfx is missing the private key.
Your application should be able to access the private key of the certificate if the pfx had it.
#RuneSynnevåg, I think you just need to follow the tutorial Enable HTTPS for an app in Azure App Service to do the steps described in the section "Get a certificate using Certreq.exe (Windows only)" and upload the pfx certificate file for your webapp by following the step 3.

SSL: how can i generate a CSR exportable to a .pfx in MMC?

I have tried an online version, but that turned out to not be exportable.
can't get openssl to work on my only (windows) comp for some reason.
I can't find a linke to download IIS full - which presumably has an IIS manager with it. I can only get iisexpress to run.
How do i generate a CSR that I can export to a .pfx (using a private key) so that I can upload said .pfx to azure?
Thanks!
You don't have to download IIS from internet. It's already in your PC. You can turn it on by: Control Panel -> Programs and Features > Turn Windows features on or off. Check Internet Information Services to proceed installation:
Install IIS on you PC
Once you done CSR creation, you can submit it to certification provider so that you will get a pfx.
Install IIS
Create CSR
Copy Txt and paste it into your certificate request
Complete the SSL certificate order
Compete the domain ownership verification by the supplier of the SSL
Supplier will email you a link to download PFX (if you are lucky), or they will email you a bunch of text starting with '---BEGIN CERTIFICATE--'
Paste that into a new text file, save as: cert.cer
Import that into your certificate store
Export the certificate as a PFX, choose a password (keep it somewhere safe)

Azure Notification Hub unable to upload .p12 for APN

I am not able to upload a .p12 for APN. and this is the error message I received. Any idea what cause this error?
SubCode=40000. Failed to validate credentials with APNS. Error is The credentials supplied to the package were not recognized..TrackingId:b18f483e-6285-9d5b-895c-12e2fcc26dcf_M1_G12,TimeStamp:4/21/2014 3:16:19 AM
I was having the same issue while uploading the certificate on the backend and finally found the solution after lot of struggling. Do the following:
Select keys from your keychain
Locate desired push private key
Click the small arrow to expand the key & profile
Now select the certificate only (this is a crucial step) no both the key & certificate ONLY SELECT CERTIFICATE and click for export
Set password for your exported certificate and upload
Have a look at this picture for reference:
This is an old question but I thought I would post something that worked for me as well. Seeing as the .p12 file was created by another part of our company I was not able to get the .p12 file re-exported in the correct manner.
Instead I imported the .p12 to my local certificate store (windows) and then re-exported as a pfx.
Take a note of where the certificate is stored
Then, Use the MMC tool to view and export your certificate, making sure to export the private key as part of the pfx.
(You should probably delete the certificate from your local machine after the export is complete.)
After that you should be able to import your new pfx file into azure via the portal.

Resources