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

Self-hosted control rooms have invalid SSL certificates, which causes api calls from the extension to fail #8144

Closed
BLoe opened this issue Apr 3, 2024 · 7 comments

Comments

@BLoe
Copy link
Collaborator

BLoe commented Apr 3, 2024

I don't know if I have all the information here, but from what I've learned so far, we have basically two options if we want to test the extension with self hosted CRs:

  • The admin console/back end has a hack where it doesn't validate SSL certs for AA api calls, we could implement a similar hack in the extension
  • We could set up certs for our self hosted CR domains (and document this process and possibly automate it?)
  • We could just not use self hosted CRs and depend on setting up cloud CRs for testing -- I believe this would add a dependency on Shane to set them up for us
@twschiller
Copy link
Contributor

twschiller commented Apr 4, 2024

Capturing discussion from Slack here:

The current approach is to download the certificate and trust it in the operating system. Our public docs are here: https://docs.pixiebrix.com/how-to/troubleshooting/troubleshooting-network-errors#the-browser-blocked-the-request-because-the-https-certificate-on-the-server-is-invalid-untrusted

we could implement a similar hack in the extension

To my knowledge that's not possible. You'd have to find a Chrome setting to not verify the SSL certificate for API calls. E.g., in Postman, there's a Postman setting to not verify the SSL certificate

@twschiller
Copy link
Contributor

twschiller commented Apr 4, 2024

@grahamlangford this should likely be @BLoe and @johnnymetz pairing to ensure our dev/test environment is working again and steps to use it are documented

@twschiller
Copy link
Contributor

For reference, other people calling out that service worker can't make API calls to server with invalid certificate: w3c/webextensions#72 (comment)

@johnnymetz
Copy link
Collaborator

johnnymetz commented May 7, 2024

Notes

Full URL: https://pixiebrix-controlroom-dev-4.eastus.cloudapp.azure.com
FQDN: pixiebrix-controlroom-dev-4.eastus.cloudapp.azure.com

Folder structure

pki folder:

  • private:
    • cert.key
    • cr.ks
  • trust:
    • store.ks
  • cert.pem

Commands I Tried

Note: I installed openssl with chocolately

[DIDN'T WORK: https://stackoverflow.com/a/41531915/6611672]

# Example
openssl pkcs12 -inkey rootCA.key -in rootCA.pem -export -out rootCA.pfx
# Actual
openssl pkcs12 -inkey private/cert.key -in cert.pem -export -out cert.pfx

[DIDN'T WORK: https://learn.microsoft.com/en-us/azure/application-gateway/self-signed-certificates]

openssl ecparam -out contoso.key -name prime256v1 -genkey
openssl req -new -sha256 -key contoso.key -out contoso.csr
openssl x509 -req -sha256 -days 365 -in contoso.csr -signkey contoso.key -out contoso.crt

openssl ecparam -out fabrikam.key -name prime256v1 -genkey
openssl req -new -sha256 -key fabrikam.key -out fabrikam.csr

openssl x509 -req -in fabrikam.csr -CA  contoso.crt -CAkey contoso.key -CAcreateserial -out fabrikam.crt -days 365 -sha256
openssl x509 -in fabrikam.crt -text -noout

Resources:

@johnnymetz
Copy link
Collaborator

@BLoe
Copy link
Collaborator Author

BLoe commented May 9, 2024

@johnnymetz I think the last thing to close out this ticket should probably just be adding that guide to our user-facing docs somewhere, and we're good to go

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

No branches or pull requests

3 participants