yesodweb / wai

Haskell Web Application Interface
MIT License
834 stars 263 forks source link

WarpTLS did not provide a way to use existing `Data.X509.CertificateChain`? #988

Closed pe200012 closed 6 months ago

pe200012 commented 6 months ago

version:

crypton-x509-1.7.6
cryptostore-0.3.0.1
warp-tls 3.4.4

Currently, if one wants to start a Warp TLS application, he/she needs have a X509 certificate file and its corresponding key(or bytes in memory). This, however, didn't allow us to do anything if one already has Data.X509.Credentials read from files.

Here is an actual scenario: I have a certificate file in PKCS12 form received from a server, and I use functions from cryptostore to extract certs/key pair from it. The pair is in fact Credentials, but I can see no way to feed it to TLSSettings without importing internal modules.

Do you have any ideas on how to solve this issue?