Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create SSL Certificate with Linux based App Service #17

Closed
RichMercer opened this issue Dec 22, 2019 · 7 comments
Closed

Unable to create SSL Certificate with Linux based App Service #17

RichMercer opened this issue Dec 22, 2019 · 7 comments

Comments

@RichMercer
Copy link
Contributor

RichMercer commented Dec 22, 2019

This needs more investigation, but there seems to be an issue with installing the certificate to the app service when using a Linux App Service. It might even be an Azure/SDK issue, but logging for further investigation.

Essentially the issue seems to be that the certificate obtained from from LetsEncrypt won't upload or isn't visible to the app service, so when creating the hostname binding, the thumbprint results in a not found exception.

@n3wt0n
Copy link
Owner

n3wt0n commented Dec 23, 2019

I've just tried on a Linux AppService and it worked.

I've tried on both a "normal" App Service on Linux (aka Code) and an App Service for Containers on Linux.

Any special conditions on yours?

@RichMercer
Copy link
Contributor Author

The only thing that comes to mind is the region. The app service I created was in North Europe and it didn’t support Insights either. I’ll try a couple of things when I get some time and see if I can reproduce.

@jtrotman10
Copy link

I'm running into this same issue with a Windows App Service (East US region). The PFX file gets created and is in the storage account but not in the PFXs for the Web app so the Update binding using the thumbprint fails. I can manually get the PFX file from the storage account and upload it to the Web App certificates location and manually update the bindings and that works.

I've stepped through and the .CreateAsync() call returns a certificate and the thumbprint is correct (same value I see when I manually upload), but the certificate isn't available in the web app.

I'm going to keep playing with it but wanted to let you know that it doesn't seem to be just a Linux issue.

BTW - Thanks for the great work. This is going to be very helpful.

@RichMercer
Copy link
Contributor Author

RichMercer commented Jan 2, 2020

So here's what I know.

  1. The certificate upload is succeeding, shown by the fact that on subsequent runs the call to get old certificates will return the recently uploaded certificate.
    var oldCertificates = _azure.AppServices.AppServiceCertificates.ListByResourceGroup(_resourceResGroup).Where(c => c.HostNames.Contains(_hostname));
  2. The certificate doesn't show up in the UI via the Portal even though the above query does return it (in my case as well as the actual certificate installed yesterday).
  3. Downloaded certificates in blob storage can be be manually uploaded and used.

So the question is, why can't the App Service see the certificates that have been uploaded? I've double checked all resource groups/subscriptions etc. in case there's a mismatch, but I cannot see a reason for this. Anybody know who is best to contact about the API for support?

@n3wt0n
Copy link
Owner

n3wt0n commented Jan 3, 2020

Thanks guys for this investigation.

I can reach out to the App Service team, but I would need something that is reproducible... And at the moment I'm unfortunately not able to repro it.

We can also try to file this as Issue on the FluentSDK but idk if that would be effective unless we can show it's an SDK problem.

@jtrotman10
Copy link

FYI - I renewed my certificates today and didn't run into this problem again (even with the sites/certificates that gave this error 3 months ago.)

@n3wt0n
Copy link
Owner

n3wt0n commented Apr 6, 2020

CLosing this issue for the time being, since we can't replicate it anymore (and tbh I haven't been ever able to replicate it 🤯)

Feel free to reopen it if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants