{"record":{"id":"6cd21b028f514096","repo":"golang/go","slug":"tls-peer-doesn-t-support-any-of-the-certificate-s","errorCode":null,"errorMessage":"tls: peer doesn't support any of the certificate's signature algorithms","messagePattern":"tls: peer doesn't support any of the certificate's signature algorithms","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/crypto/tls/auth.go","lineNumber":297,"sourceCode":"\t}\n\tif len(peerAlgs) == 0 && vers == VersionTLS12 {\n\t\t// For TLS 1.2, if the client didn't send signature_algorithms then we\n\t\t// can assume that it supports SHA1. See RFC 5246, Section 7.4.1.4.1.\n\t\t// RFC 9155 made signature_algorithms mandatory in TLS 1.2, and we gated\n\t\t// it behind the tlssha1 GODEBUG setting.\n\t\tif tlssha1.Value() != \"1\" {\n\t\t\treturn 0, errors.New(\"tls: missing signature_algorithms from TLS 1.2 peer\")\n\t\t}\n\t\tpeerAlgs = []SignatureScheme{PKCS1WithSHA1, ECDSAWithSHA1}\n\t}\n\t// Pick signature scheme in the peer's preference order, as our\n\t// preference order is not configurable.\n\tfor _, preferredAlg := range peerAlgs {\n\t\tif isSupportedSignatureAlgorithm(preferredAlg, supportedAlgs) {\n\t\t\treturn preferredAlg, nil\n\t\t}\n\t}\n\treturn 0, errors.New(\"tls: peer doesn't support any of the certificate's signature algorithms\")\n}\n\n// unsupportedCertificateError returns a helpful error for certificates with\n// an unsupported private key.\nfunc unsupportedCertificateError(cert *Certificate) error {\n\tswitch cert.PrivateKey.(type) {\n\tcase rsa.PrivateKey, ecdsa.PrivateKey:\n\t\treturn fmt.Errorf(\"tls: unsupported certificate: private key is %T, expected *%T\",\n\t\t\tcert.PrivateKey, cert.PrivateKey)\n\tcase *ed25519.PrivateKey:\n\t\treturn fmt.Errorf(\"tls: unsupported certificate: private key is *ed25519.PrivateKey, expected ed25519.PrivateKey\")\n\t}\n\n\tsigner, ok := cert.PrivateKey.(crypto.Signer)\n\tif !ok {\n\t\treturn fmt.Errorf(\"tls: certificate private key (%T) does not implement crypto.Signer\",\n\t\t\tcert.PrivateKey)\n\t}","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/crypto/tls/auth.go#L279-L315","documentation":"Thrown by selectSignatureScheme when no peer-advertised signature algorithm is also in the certificate's supported set. After filtering disabled algorithms and walking peerAlgs in preference order, no overlap was found, so the certificate cannot produce a signature the peer will accept.","triggerScenarios":"The peer's signature_algorithms list and the algorithms usable by the configured certificate (RSA-PSS, ECDSA, Ed25519, etc.) are disjoint. Reached at the end of selectSignatureScheme.","commonSituations":"Certificate is ECDSA but peer only advertises RSA algorithms (or vice versa); peer only offers SHA-1 schemes which Go disabled; an RSA cert below the peer's minimum key size; misconfigured client restricting signature_algorithms too aggressively.","solutions":["Provide a certificate whose key type matches an algorithm the peer advertises (e.g., add an RSA cert if peer is RSA-only).","Inspect the peer's ClientHello signature_algorithms (e.g., with a TLS debug log) and align the certificate choice.","Upgrade the peer to advertise modern schemes (rsa_pss_rsae_sha256, ecdsa_secp256r1_sha256).","For multi-cert setups, configure Config.GetCertificate to pick a compatible cert by ClientHelloInfo.SignatureSchemes."],"exampleFix":"// before: only an ECDSA cert, peer advertises RSA-only\ncfg.Certificates = []tls.Certificate{ecdsaCert}\n\n// after: also offer an RSA cert and select by SNI/schemes\ncfg.Certificates = []tls.Certificate{ecdsaCert, rsaCert}\ncfg.GetCertificate = func(chi *tls.ClientHelloInfo) (*tls.Certificate, error) {\n    for _, s := range chi.SignatureSchemes {\n        if isRSA(s) { return &rsaCert, nil }\n    }\n    return &ecdsaCert, nil\n}","handlingStrategy":"fallback","validationCode":"// Choose a certificate whose key type matches the peer's advertised schemes.\nfunc pickCert(chi *tls.ClientHelloInfo, certs map[string]tls.Certificate) (*tls.Certificate, error) {\n    for _, s := range chi.SignatureSchemes {\n        switch {\n        case isRSAScheme(s) && certs[\"rsa\"] != (tls.Certificate{}):\n            c := certs[\"rsa\"]; return &c, nil\n        case isECDSAScheme(s) && certs[\"ecdsa\"] != (tls.Certificate{}):\n            c := certs[\"ecdsa\"]; return &c, nil\n        }\n    }\n    return nil, errors.New(\"no cert matches peer signature schemes\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Provide both RSA and ECDSA certs and select via GetCertificate.","Inspect peer ClientHello SignatureSchemes during testing to confirm overlap.","Avoid disabling all modern schemes in client configs.","Ensure cert key sizes meet peer minimums (e.g., RSA >= 2048)."],"tags":["crypto","tls","handshake","signature-algorithms","go"],"backgroundTag":null,"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}