Skip to content

RegisterTLSConfig can panic with "fatal error: concurrent map writes" #610

Closed
@daniel-nichter

Description

@daniel-nichter

If multiple goroutines call RegisterTLSConfig Go can panic because the internal map is not guarded: tlsConfigRegister[key] = config

Affects all versions of driver including latest SHA as of today.

Suggested fixes:

  1. Guard the map, or
  2. Document that this func isn't thread-safe and caller should only call it once

Best is probably option 1 and then document that callers shouldn't (and don't need to) re-register the same TLS config more than once (unless, of course, certs change).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions