@@ -25,6 +25,7 @@ import (
2525 "github.com/stretchr/testify/require"
2626 "go.mongodb.org/mongo-driver/v2/mongo"
2727 "go.mongodb.org/mongo-driver/v2/x/mongo/driver"
28+ "go.mongodb.org/mongo-driver/v2/x/mongo/driver/topology"
2829 "go.temporal.io/sdk/temporal"
2930 "google.golang.org/api/googleapi"
3031
@@ -846,6 +847,29 @@ func TestMongoCursorErrors(t *testing.T) {
846847 }, errInfo )
847848}
848849
850+ func TestMongoTLSInvalidServerCertSignatureShouldBeRecoverable (t * testing.T ) {
851+ de := driver.Error {
852+ Labels : []string {driver .NetworkError },
853+ Wrapped : topology.ConnectionError {
854+ Wrapped : errors .New (
855+ "failed to configure TLS for pl-1-us-east-1.xxxx.mongodb.net:1234: " +
856+ "tls: invalid signature by the server certificate: crypto/rsa: verification error" ),
857+ },
858+ }
859+ err := mongo.CommandError {
860+ Code : de .Code ,
861+ Message : de .Message ,
862+ Labels : de .Labels ,
863+ Wrapped : de ,
864+ }
865+ errorClass , errInfo := GetErrorClass (t .Context (), fmt .Errorf ("failed to create change stream: %w" , err ))
866+ assert .Equal (t , ErrorRetryRecoverable , errorClass )
867+ assert .Equal (t , ErrorInfo {
868+ Source : ErrorSourceMongoDB ,
869+ Code : "0" ,
870+ }, errInfo )
871+ }
872+
849873func TestAuroraMySQLZeroDowntimePatchErrorShouldBeRecoverable (t * testing.T ) {
850874 // Simulate Aurora MySQL Zero Downtime Patch error
851875 mysqlErr := & mysql.MyError {
0 commit comments