haskell/wreq

Don't call certificate-related functions when not checking certificates

VichoReyes opened this issue · 2 comments

I want to make an app that calls an api in http://localhost/, so it doesn't make too much sense to use certificates.
So, because of this bug in hs-certificate I decided to disable them following the instructions mentioned in issue #102, but the program still spends most of its time on functions from Data.X509.CertificateStore, acording to the profiling report.

So, maybe the library could realize I'm not using https and just avoid calling those functions?

Do you have more information about this? Like from where in particular it gets called?

Got the following stack trace by sending SIGINT:

*** Exception (reporting due to +RTS -xc): (THUNK_STATIC), stack trace: 
  Data.X509.CertificateStore.readCertificates,
  called from Data.X509.CertificateStore.readCertificateStore.makeDirStore,
  called from Data.X509.CertificateStore.readCertificateStore,
  called from System.X509.Unix.getSystemCertificateStore,
  called from Network.Connection.initConnectionContext,
  called from Network.HTTP.Client.TLS.getTlsConnection,
  called from Network.HTTP.Client.TLS.mkManagerSettingsContext',
  called from Network.HTTP.Client.TLS.mkManagerSettingsContext,
  called from Network.HTTP.Client.TLS.mkManagerSettings,
  called from Network.HTTP.Client.TLS.tlsManagerSettings,
  called from Network.HTTP.Client.Types.managerTlsConnection,
  called from Network.HTTP.Client.Manager.mkCreateConnection,
  called from Network.HTTP.Client.Manager.newManager,
  called from Network.Wreq.Session.newSessionControl,
  called from Network.Wreq.Session.newAPISession,

But I pretty much abandoned the side project I had that had this problem, so close this if you want to.