haskell-tls / hs-certificate

Certificate and Key Reader/Writer in haskell
60 stars 57 forks source link

Favours OpenSSL environment variables: SSL_CERT_FILE and SSL_CERT_DIR #127

Open meghfossa opened 2 years ago

meghfossa commented 2 years ago

Overview

This PR modifies System.X509's getSystemCertificateStore method, to favour OpenSSL environment variables (as used by git, curl, etc) namely:

If SSL_CERT_FILE or SSL_CERT_DIR values do not exist, previously implemented certificationStore is yielded.

Order of precedence:

1) SSL_CERT_FILE (OpenSSL conventional env name) 2) SSL_CERT_DIR (OpenSSL conventional env name) 3) SYSTEM_CERTIFICATE_PATH (Unix Only - Existing implementation)

To-do

Reference

meghfossa commented 2 years ago

@vincenthz tagging your for review. PR is fairly small.