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

Import-Certificate #520

Open
Fareroo7 opened this issue Feb 17, 2023 · 3 comments
Open

Import-Certificate #520

Fareroo7 opened this issue Feb 17, 2023 · 3 comments

Comments

@Fareroo7
Copy link

I want to use self-signed certificates, like described here: HOWTO

When I try to run this command:

Import-Certificate -FilePath C:\Run\my\certs\tls.crt -CertStoreLocation Cert:\LocalMachine\My\

the following error occurs:

Import-Certificate : Error HRESULT E_FAIL has been returned from a call to a COM component.
At line:1 char:1
+ Import-Certificate -FilePath C:\Run\my\certs\tls.crt -CertStoreLocati ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Import-Certificate], COMException
    + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Microsoft.CertificateServices.Commands.ImportCertificateCommand
@freddydk
Copy link
Contributor

Using BcContainerHelper and the -useSSL switch on New-BcContainer will give you a self-signed certificate.

@rdebath
Copy link

rdebath commented Mar 8, 2024

@freddydk OP's link doesn't point to an actual "self-signed" certificate despite their description.
Instead it points to using something like a "domain signed" certificate or some other private CA.

@Fareroo7 We'd need more information than just that command.

But if you're following that HowTO I had to include -useSSL in addition to the script; it's needed to call the script after all.
And you need to load a PFX into \My because the service tier needs access to the private key (which is likely protected by a password).

@Fareroo7
Copy link
Author

@freddydk, @rdebath thank you for ur comments!

Yes, ofc here some more details:

im managing the bc containers with kubernetes for our dev team and there I want to implement ssl-certificates.
The self-signed certificate is already created in kubernetes with cert-manager.
I want to use the exisiting certificate and added an custom script to import it, but the command listed above create and exeption...

And I don't know why the default script for generating self-signed certificates (for example from the BcContainerHelper) is working but my script is not able to import the certificate.

Hope this explains my situation a little bit better.

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