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

[Feature Request] MISE supports certificate in PEM format on NET 6+ #2487

Open
luz1115 opened this issue Sep 29, 2023 · 1 comment
Open

[Feature Request] MISE supports certificate in PEM format on NET 6+ #2487

luz1115 opened this issue Sep 29, 2023 · 1 comment
Labels

Comments

@luz1115
Copy link

luz1115 commented Sep 29, 2023

Is your feature request related to a problem? Please describe.
Received exception when loading token decryption certificate from Keyvault, with MISE migration:
'Microsoft.IdentityModel.S2S.Configuration.S2SAuthenticationManagerFactory' caught exceptions when loading the certificate. Exception : 'IDW10701: Only PKCS #12 content type is supported. Found Content-Type: application/x-pem-file. '

solution is at NET 6.0

Describe the solution you'd like
A clear and concise description of what you want to happen.
Please support PEM formatted certificate with MISE migration.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@luz1115 luz1115 added enhancement New feature or request feature request labels Sep 29, 2023
@jmprieur
Copy link
Collaborator

jmprieur commented Sep 30, 2023

The fix should be done here:

if (CertificateConstants.MediaTypePksc12.Equals(secret.Properties.ContentType, StringComparison.OrdinalIgnoreCase))

if (secret .Value.Properties.ContentType == "application/x-pem-file")
{
   cert = X509Certificate2.CreateFromPem(secret.Value, secret.Value);
}

@jmprieur jmprieur added the 1P label Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants