Azure / Azure/azure-functions-core-tools

Unable to access certificate in Azure function

Open
#1,889 3 comments 0 reactions 0 assignees View on GitHub
investigate
Dominant language
C#
Stars
1.5k
Forks
498
Avg merge
4d 20h
Merged PRs (30d)
14

Description

I am executing my Azure function locally on HTTPS with the application arguments:
```
host start --useHttps --cert "server.pfx" --password ajay
```

where `server.pfx` is a self-signed certificate.

In the postman setting, I have set certificate for the URL corresponding to the function app.
![PostmanCertSettings](https://user-images.githubusercontent.com/16772764/76388599-7ef9e180-638f-11ea-8a4e-a766830bcf38.PNG)

In Azure function, I am reading certificate as follow:
```
var clientCert = req.HttpContext.Connection.ClientCertificate;
```

`clientCert` instance is always `null`. Am I missing some steps here ?

Contributor guide

Open the contributing guide

Research direction

Reproduce the local HTTPS invocation using `host start --useHttps --cert "server.pfx" --password ajay` and the Postman certificate settings shown in the issue. Start at `req.HttpContext.Connection.ClientCertificate`; determine why it is null and document the required configuration or behavior once the certificate is accessible.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.