Enable lazy tls reload for new connections

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Do
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Go Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      The driver loads tlsCAFile / tlsCertificateKeyFile etc. once at ApplyURI time and caches the resulting *tls.Config. After on-disk cert rotation, every new connection keeps using the stale in-memory cert until process restart. Even though the rotated material is sitting on disk. Operators rotating certs out-of-band currently need to bounce the process or wire up tls.Config.GetClientCertificate themselves. This patch makes rotation transparent: the next failing handshake triggers one reload, and tlsCertificateKeyFile-based clients self-heal on the spot.

      Definition of done

      Add lazy TLS cert reload on handshake failure. When a new connection's TLS handshake fails and the *tls.Config was loaded from URI cert files, the driver re-reads those files once, atomically publishes the fresh config to the pool, and retries the handshake exactly once. Existing connections are not touched.

      Pitfalls

      What should the implementer watch out for? What are the risks?

            Assignee:
            Preston Vasquez
            Reporter:
            Qingyang Hu
            Qingyang Hu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: