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

Difference between CertFromFile and CertFromMemory #1005

Open
bflyblue opened this issue Sep 22, 2024 · 0 comments
Open

Difference between CertFromFile and CertFromMemory #1005

bflyblue opened this issue Sep 22, 2024 · 0 comments

Comments

@bflyblue
Copy link

I'm not sure if this is intended behavior or not but I've noticed a difference between using CertFromFile and CertFromMemory. The latter receives the certificate chain in reverse order due to differences in how TLS.credentialLoadX509Chain and TLS.credentialLoadX509ChainFromMemory construct the results. I don't know enough to know if the order is meant to matter in a certificate chain:

    CertFromFile cert chainFiles key -> do
        cred <- either error id <$> TLS.credentialLoadX509Chain cert chainFiles key
        return $ TLS.Credentials [cred]
    ...
    CertFromMemory certMemory chainCertsMemory keyMemory -> do
        cred <-
            either error return $
                TLS.credentialLoadX509ChainFromMemory certMemory chainCertsMemory keyMemory
        return $ TLS.Credentials [cred]

When using warp-tls's tlsSettings vs tlsSettingsMemory the first works where-as the latter results in curl and wget failing with:
curl: (35) OpenSSL/3.0.14: error:0A00007B:SSL routines::bad signature

Flipping the order of the certs in my "fullchain.pem" file manually allows tlsSettingsMemory to work as expected.

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

1 participant