...

Text file src/go.mongodb.org/mongo-driver/testdata/uri-options/tls-options.yml

Documentation: go.mongodb.org/mongo-driver/testdata/uri-options

     1tests:
     2    -
     3        description: "Valid required tls options are parsed correctly"
     4        uri: "mongodb://example.com/?tls=true&tlsCAFile=ca.pem&tlsCertificateKeyFile=cert.pem"
     5        valid: true
     6        warning: false
     7        hosts: ~
     8        auth: ~
     9        options:
    10            tls: true
    11            tlsCAFile: "ca.pem"
    12            tlsCertificateKeyFile: "cert.pem"
    13    -
    14        description: "Valid tlsCertificateKeyFilePassword is parsed correctly"
    15        uri: "mongodb://example.com/?tlsCertificateKeyFilePassword=hunter2"
    16        valid: true
    17        warning: false
    18        hosts: ~
    19        auth: ~
    20        options:
    21            tlsCertificateKeyFilePassword: "hunter2"
    22    -
    23        description: "Invalid tlsAllowInvalidCertificates causes a warning"
    24        uri: "mongodb://example.com/?tlsAllowInvalidCertificates=invalid"
    25        valid: true
    26        warning: true
    27        hosts: ~
    28        auth: ~
    29        options: {}
    30    -
    31        description: "tlsAllowInvalidCertificates is parsed correctly"
    32        uri: "mongodb://example.com/?tlsAllowInvalidCertificates=true"
    33        valid: true
    34        warning: false
    35        hosts: ~
    36        auth: ~
    37        options:
    38            tlsAllowInvalidCertificates: true
    39    -
    40        description: "Invalid tlsAllowInvalidCertificates causes a warning"
    41        uri: "mongodb://example.com/?tlsAllowInvalidCertificates=invalid"
    42        valid: true
    43        warning: true
    44        hosts: ~
    45        auth: ~
    46        options: {}
    47    -
    48        description: "tlsAllowInvalidHostnames is parsed correctly"
    49        uri: "mongodb://example.com/?tlsAllowInvalidHostnames=true"
    50        valid: true
    51        warning: false
    52        hosts: ~
    53        auth: ~
    54        options:
    55            tlsAllowInvalidHostnames: true
    56    -
    57        description: "Invalid tlsAllowInvalidHostnames causes a warning"
    58        uri: "mongodb://example.com/?tlsAllowInvalidHostnames=invalid"
    59        valid: true
    60        warning: true
    61        hosts: ~
    62        auth: ~
    63        options: {}
    64    -
    65        description: "tlsInsecure is parsed correctly"
    66        uri: "mongodb://example.com/?tlsInsecure=true"
    67        valid: true
    68        warning: false
    69        hosts: ~
    70        auth: ~
    71        options:
    72            tlsInsecure: true
    73    -
    74        description: "Invalid tlsInsecure causes a warning"
    75        uri: "mongodb://example.com/?tlsInsecure=invalid"
    76        valid: true
    77        warning: true
    78        hosts: ~
    79        auth: ~
    80        options: {}
    81    -
    82        description: "tlsInsecure and tlsAllowInvalidCertificates both present (and true) raises an error"
    83        uri: "mongodb://example.com/?tlsInsecure=true&tlsAllowInvalidCertificates=true"
    84        valid: false
    85        warning: false
    86        hosts: ~
    87        auth: ~
    88        options: {}
    89    -
    90        description: "tlsInsecure and tlsAllowInvalidCertificates both present (and false) raises an error"
    91        uri: "mongodb://example.com/?tlsInsecure=false&tlsAllowInvalidCertificates=false"
    92        valid: false
    93        warning: false
    94        hosts: ~
    95        auth: ~
    96        options: {}
    97    -
    98        description: "tlsAllowInvalidCertificates and tlsInsecure both present (and true) raises an error"
    99        uri: "mongodb://example.com/?tlsAllowInvalidCertificates=true&tlsInsecure=true"
   100        valid: false
   101        warning: false
   102        hosts: ~
   103        auth: ~
   104        options: {}
   105    -
   106        description: "tlsAllowInvalidCertificates and tlsInsecure both present (and false) raises an error"
   107        uri: "mongodb://example.com/?tlsAllowInvalidCertificates=false&tlsInsecure=false"
   108        valid: false
   109        warning: false
   110        hosts: ~
   111        auth: ~
   112        options: {}
   113    -
   114        description: "tlsInsecure and tlsAllowInvalidHostnames both present (and true) raises an error"
   115        uri: "mongodb://example.com/?tlsInsecure=true&tlsAllowInvalidHostnames=true"
   116        valid: false
   117        warning: false
   118        hosts: ~
   119        auth: ~
   120        options: {}
   121    -
   122        description: "tlsInsecure and tlsAllowInvalidHostnames both present (and false) raises an error"
   123        uri: "mongodb://example.com/?tlsInsecure=false&tlsAllowInvalidHostnames=false"
   124        valid: false
   125        warning: false
   126        hosts: ~
   127        auth: ~
   128        options: {}
   129    -
   130        description: "tlsAllowInvalidHostnames and tlsInsecure both present (and true) raises an error"
   131        uri: "mongodb://example.com/?tlsAllowInvalidHostnames=true&tlsInsecure=true"
   132        valid: false
   133        warning: false
   134        hosts: ~
   135        auth: ~
   136        options: {}
   137    -
   138        description: "tlsAllowInvalidHostnames and tlsInsecure both present (and false) raises an error"
   139        uri: "mongodb://example.com/?tlsAllowInvalidHostnames=false&tlsInsecure=false"
   140        valid: false
   141        warning: false
   142        hosts: ~
   143        auth: ~
   144        options: {}
   145    -
   146        description: "tls=true and ssl=true doesn't warn"
   147        uri: "mongodb://example.com/?tls=true&ssl=true"
   148        valid: true
   149        warning: false
   150        hosts: ~
   151        auth: ~
   152        options: {}
   153    -
   154        description: "tls=false and ssl=false doesn't warn"
   155        uri: "mongodb://example.com/?tls=false&ssl=false"
   156        valid: true
   157        warning: false
   158        hosts: ~
   159        auth: ~
   160        options: {}
   161    -
   162        description: "ssl=true and tls=true doesn't warn"
   163        uri: "mongodb://example.com/?ssl=true&tls=true"
   164        valid: true
   165        warning: false
   166        hosts: ~
   167        auth: ~
   168        options: {}
   169    -
   170        description: "ssl=false and tls=false doesn't warn"
   171        uri: "mongodb://example.com/?ssl=false&tls=false"
   172        valid: true
   173        warning: false
   174        hosts: ~
   175        auth: ~
   176        options: {}
   177    -
   178        description: "tls=false and ssl=true raises error"
   179        uri: "mongodb://example.com/?tls=false&ssl=true"
   180        valid: false
   181        warning: false
   182        hosts: ~
   183        auth: ~
   184        options: {}
   185    -
   186        description: "tls=true and ssl=false raises error"
   187        uri: "mongodb://example.com/?tls=true&ssl=false"
   188        valid: false
   189        warning: false
   190        hosts: ~
   191        auth: ~
   192        options: {}
   193    -
   194        description: "ssl=false and tls=true raises error"
   195        uri: "mongodb://example.com/?ssl=false&tls=true"
   196        valid: false
   197        warning: false
   198        hosts: ~
   199        auth: ~
   200        options: {}
   201    -
   202        description: "ssl=true and tls=false raises error"
   203        uri: "mongodb://example.com/?ssl=true&tls=false"
   204        valid: false
   205        warning: false
   206        hosts: ~
   207        auth: ~
   208        options: {}
   209    -
   210        description: "tlsDisableCertificateRevocationCheck can be set to true"
   211        uri: "mongodb://example.com/?tls=true&tlsDisableCertificateRevocationCheck=true"
   212        valid: true
   213        warning: false
   214        hosts: ~
   215        auth: ~
   216        options:
   217            tls: true
   218            tlsDisableCertificateRevocationCheck: true
   219    -
   220        description: "tlsDisableCertificateRevocationCheck can be set to false"
   221        uri: "mongodb://example.com/?tls=true&tlsDisableCertificateRevocationCheck=false"
   222        valid: true
   223        warning: false
   224        hosts: ~
   225        auth: ~
   226        options:
   227            tls: true
   228            tlsDisableCertificateRevocationCheck: false
   229    # 4 permutations of [tlsAllowInvalidCertificates=true/false, tlsDisableCertificateRevocationCheck=true/false]
   230    -
   231        description: "tlsAllowInvalidCertificates and tlsDisableCertificateRevocationCheck both present (and true) raises an error"
   232        uri: "mongodb://example.com/?tlsAllowInvalidCertificates=true&tlsDisableCertificateRevocationCheck=true"
   233        valid: false
   234        warning: false
   235        hosts: ~
   236        auth: ~
   237        options: {}
   238    -
   239        description: "tlsAllowInvalidCertificates=true and tlsDisableCertificateRevocationCheck=false raises an error"
   240        uri: "mongodb://example.com/?tlsAllowInvalidCertificates=true&tlsDisableCertificateRevocationCheck=false"
   241        valid: false
   242        warning: false
   243        hosts: ~
   244        auth: ~
   245        options: {}
   246    -
   247        description: "tlsAllowInvalidCertificates=false and tlsDisableCertificateRevocationCheck=true raises an error"
   248        uri: "mongodb://example.com/?tlsAllowInvalidCertificates=false&tlsDisableCertificateRevocationCheck=true"
   249        valid: false
   250        warning: false
   251        hosts: ~
   252        auth: ~
   253        options: {}
   254    -
   255        description: "tlsAllowInvalidCertificates and tlsDisableCertificateRevocationCheck both present (and false) raises an error"
   256        uri: "mongodb://example.com/?tlsAllowInvalidCertificates=false&tlsDisableCertificateRevocationCheck=false"
   257        valid: false
   258        warning: false
   259        hosts: ~
   260        auth: ~
   261        options: {}
   262    # 4 permutations of [tlsDisableCertificateRevocationCheck=true/false, tlsAllowInvalidCertificates=true/false]
   263    -
   264        description: "tlsDisableCertificateRevocationCheck and tlsAllowInvalidCertificates both present (and true) raises an error"
   265        uri: "mongodb://example.com/?tlsDisableCertificateRevocationCheck=true&tlsAllowInvalidCertificates=true"
   266        valid: false
   267        warning: false
   268        hosts: ~
   269        auth: ~
   270        options: {}
   271    -
   272        description: "tlsDisableCertificateRevocationCheck=true and tlsAllowInvalidCertificates=false raises an error"
   273        uri: "mongodb://example.com/?tlsDisableCertificateRevocationCheck=true&tlsAllowInvalidCertificates=false"
   274        valid: false
   275        warning: false
   276        hosts: ~
   277        auth: ~
   278        options: {}
   279    -
   280        description: "tlsDisableCertificateRevocationCheck=false and tlsAllowInvalidCertificates=true raises an error"
   281        uri: "mongodb://example.com/?tlsDisableCertificateRevocationCheck=false&tlsAllowInvalidCertificates=true"
   282        valid: false
   283        warning: false
   284        hosts: ~
   285        auth: ~
   286        options: {}
   287    -
   288        description: "tlsDisableCertificateRevocationCheck and tlsAllowInvalidCertificates both present (and false) raises an error"
   289        uri: "mongodb://example.com/?tlsDisableCertificateRevocationCheck=false&tlsAllowInvalidCertificates=false"
   290        valid: false
   291        warning: false
   292        hosts: ~
   293        auth: ~
   294        options: {}
   295    # 4 permutations of [tlsInsecure=true/false, tlsDisableCertificateRevocationCheck=true/false]
   296    -
   297        description: "tlsInsecure and tlsDisableCertificateRevocationCheck both present (and true) raises an error"
   298        uri: "mongodb://example.com/?tlsInsecure=true&tlsDisableCertificateRevocationCheck=true"
   299        valid: false
   300        warning: false
   301        hosts: ~
   302        auth: ~
   303        options: {}
   304    -
   305        description: "tlsInsecure=true and tlsDisableCertificateRevocationCheck=false raises an error"
   306        uri: "mongodb://example.com/?tlsInsecure=true&tlsDisableCertificateRevocationCheck=false"
   307        valid: false
   308        warning: false
   309        hosts: ~
   310        auth: ~
   311        options: {}
   312    -
   313        description: "tlsInsecure=false and tlsDisableCertificateRevocationCheck=true raises an error"
   314        uri: "mongodb://example.com/?tlsInsecure=false&tlsDisableCertificateRevocationCheck=true"
   315        valid: false
   316        warning: false
   317        hosts: ~
   318        auth: ~
   319        options: {}
   320    -
   321        description: "tlsInsecure and tlsDisableCertificateRevocationCheck both present (and false) raises an error"
   322        uri: "mongodb://example.com/?tlsInsecure=false&tlsDisableCertificateRevocationCheck=false"
   323        valid: false
   324        warning: false
   325        hosts: ~
   326        auth: ~
   327        options: {}
   328    # 4 permutations of [tlsDisableCertificateRevocationCheck=true/false, tlsInsecure=true/false]
   329    -
   330        description: "tlsDisableCertificateRevocationCheck and tlsInsecure both present (and true) raises an error"
   331        uri: "mongodb://example.com/?tlsDisableCertificateRevocationCheck=true&tlsInsecure=true"
   332        valid: false
   333        warning: false
   334        hosts: ~
   335        auth: ~
   336        options: {}
   337    -
   338        description: "tlsDisableCertificateRevocationCheck=true and tlsInsecure=false raises an error"
   339        uri: "mongodb://example.com/?tlsDisableCertificateRevocationCheck=true&tlsInsecure=false"
   340        valid: false
   341        warning: false
   342        hosts: ~
   343        auth: ~
   344        options: {}
   345    -
   346        description: "tlsDisableCertificateRevocationCheck=false and tlsInsecure=true raises an error"
   347        uri: "mongodb://example.com/?tlsDisableCertificateRevocationCheck=false&tlsInsecure=true"
   348        valid: false
   349        warning: false
   350        hosts: ~
   351        auth: ~
   352        options: {}
   353    -
   354        description: "tlsDisableCertificateRevocationCheck and tlsInsecure both present (and false) raises an error"
   355        uri: "mongodb://example.com/?tlsDisableCertificateRevocationCheck=false&tlsInsecure=false"
   356        valid: false
   357        warning: false
   358        hosts: ~
   359        auth: ~
   360        options: {}
   361    # 4 permutations of [tlsDisableCertificateRevocationCheck=true/false, tlsDisableOCSPEndpointCheck=true/false]
   362    -
   363        description: "tlsDisableCertificateRevocationCheck and tlsDisableOCSPEndpointCheck both present (and true) raises an error"
   364        uri: "mongodb://example.com/?tlsDisableCertificateRevocationCheck=true&tlsDisableOCSPEndpointCheck=true"
   365        valid: false
   366        warning: false
   367        hosts: ~
   368        auth: ~
   369        options: {}
   370    -
   371        description: "tlsDisableCertificateRevocationCheck=true and tlsDisableOCSPEndpointCheck=false raises an error"
   372        uri: "mongodb://example.com/?tlsDisableCertificateRevocationCheck=true&tlsDisableOCSPEndpointCheck=false"
   373        valid: false
   374        warning: false
   375        hosts: ~
   376        auth: ~
   377        options: {}
   378    -
   379        description: "tlsDisableCertificateRevocationCheck=false and tlsDisableOCSPEndpointCheck=true raises an error"
   380        uri: "mongodb://example.com/?tlsDisableCertificateRevocationCheck=false&tlsDisableOCSPEndpointCheck=true"
   381        valid: false
   382        warning: false
   383        hosts: ~
   384        auth: ~
   385        options: {}
   386    -
   387        description: "tlsDisableCertificateRevocationCheck and tlsDisableOCSPEndpointCheck both present (and false) raises an error"
   388        uri: "mongodb://example.com/?tlsDisableCertificateRevocationCheck=false&tlsDisableOCSPEndpointCheck=false"
   389        valid: false
   390        warning: false
   391        hosts: ~
   392        auth: ~
   393        options: {}
   394    # 4 permutations of [tlsDisableOCSPEndpointCheck=true/false, tlsDisableCertificateRevocationCheck=true/false]
   395    -
   396        description: "tlsDisableOCSPEndpointCheck and tlsDisableCertificateRevocationCheck both present (and true) raises an error"
   397        uri: "mongodb://example.com/?tlsDisableOCSPEndpointCheck=true&tlsDisableCertificateRevocationCheck=true"
   398        valid: false
   399        warning: false
   400        hosts: ~
   401        auth: ~
   402        options: {}
   403    -
   404        description: "tlsDisableOCSPEndpointCheck=true and tlsDisableCertificateRevocationCheck=false raises an error"
   405        uri: "mongodb://example.com/?tlsDisableOCSPEndpointCheck=true&tlsDisableCertificateRevocationCheck=false"
   406        valid: false
   407        warning: false
   408        hosts: ~
   409        auth: ~
   410        options: {}
   411    -
   412        description: "tlsDisableOCSPEndpointCheck=false and tlsDisableCertificateRevocationCheck=true raises an error"
   413        uri: "mongodb://example.com/?tlsDisableOCSPEndpointCheck=false&tlsDisableCertificateRevocationCheck=true"
   414        valid: false
   415        warning: false
   416        hosts: ~
   417        auth: ~
   418        options: {}
   419    -
   420        description: "tlsDisableOCSPEndpointCheck and tlsDisableCertificateRevocationCheck both present (and false) raises an error"
   421        uri: "mongodb://example.com/?tlsDisableOCSPEndpointCheck=false&tlsDisableCertificateRevocationCheck=false"
   422        valid: false
   423        warning: false
   424        hosts: ~
   425        auth: ~
   426        options: {}
   427    -
   428        description: "tlsDisableOCSPEndpointCheck can be set to true"
   429        uri: "mongodb://example.com/?tls=true&tlsDisableOCSPEndpointCheck=true"
   430        valid: true
   431        warning: false
   432        hosts: ~
   433        auth: ~
   434        options:
   435            tls: true
   436            tlsDisableOCSPEndpointCheck: true
   437    -
   438        description: "tlsDisableOCSPEndpointCheck can be set to false"
   439        uri: "mongodb://example.com/?tls=true&tlsDisableOCSPEndpointCheck=false"
   440        valid: true
   441        warning: false
   442        hosts: ~
   443        auth: ~
   444        options:
   445            tls: true
   446            tlsDisableOCSPEndpointCheck: false
   447    # 4 permutations of [tlsInsecure=true/false, tlsDisableOCSPEndpointCheck=true/false]
   448    -
   449        description: "tlsInsecure and tlsDisableOCSPEndpointCheck both present (and true) raises an error"
   450        uri: "mongodb://example.com/?tlsInsecure=true&tlsDisableOCSPEndpointCheck=true"
   451        valid: false
   452        warning: false
   453        hosts: ~
   454        auth: ~
   455        options: {}
   456    -
   457        description: "tlsInsecure=true and tlsDisableOCSPEndpointCheck=false raises an error"
   458        uri: "mongodb://example.com/?tlsInsecure=true&tlsDisableOCSPEndpointCheck=false"
   459        valid: false
   460        warning: false
   461        hosts: ~
   462        auth: ~
   463        options: {}
   464    -
   465        description: "tlsInsecure=false and tlsDisableOCSPEndpointCheck=true raises an error"
   466        uri: "mongodb://example.com/?tlsInsecure=false&tlsDisableOCSPEndpointCheck=true"
   467        valid: false
   468        warning: false
   469        hosts: ~
   470        auth: ~
   471        options: {}
   472    -
   473        description: "tlsInsecure and tlsDisableOCSPEndpointCheck both present (and false) raises an error"
   474        uri: "mongodb://example.com/?tlsInsecure=false&tlsDisableOCSPEndpointCheck=false"
   475        valid: false
   476        warning: false
   477        hosts: ~
   478        auth: ~
   479        options: {}
   480    # 4 permutations of [tlsDisableOCSPEndpointCheck=true/false, tlsInsecure=true/false]
   481    -
   482        description: "tlsDisableOCSPEndpointCheck and tlsInsecure both present (and true) raises an error"
   483        uri: "mongodb://example.com/?tlsDisableOCSPEndpointCheck=true&tlsInsecure=true"
   484        valid: false
   485        warning: false
   486        hosts: ~
   487        auth: ~
   488        options: {}
   489    -
   490        description: "tlsDisableOCSPEndpointCheck=true and tlsInsecure=false raises an error"
   491        uri: "mongodb://example.com/?tlsDisableOCSPEndpointCheck=true&tlsInsecure=false"
   492        valid: false
   493        warning: false
   494        hosts: ~
   495        auth: ~
   496        options: {}
   497    -
   498        description: "tlsDisableOCSPEndpointCheck=false and tlsInsecure=true raises an error"
   499        uri: "mongodb://example.com/?tlsDisableOCSPEndpointCheck=false&tlsInsecure=true"
   500        valid: false
   501        warning: false
   502        hosts: ~
   503        auth: ~
   504        options: {}
   505    -
   506        description: "tlsDisableOCSPEndpointCheck and tlsInsecure both present (and false) raises an error"
   507        uri: "mongodb://example.com/?tlsDisableOCSPEndpointCheck=false&tlsInsecure=false"
   508        valid: false
   509        warning: false
   510        hosts: ~
   511        auth: ~
   512        options: {}
   513    # 4 permutations of [tlsAllowInvalidCertificates=true/false, tlsDisableOCSPEndpointCheck=true/false]
   514    -
   515        description: "tlsAllowInvalidCertificates and tlsDisableOCSPEndpointCheck both present (and true) raises an error"
   516        uri: "mongodb://example.com/?tlsAllowInvalidCertificates=true&tlsDisableOCSPEndpointCheck=true"
   517        valid: false
   518        warning: false
   519        hosts: ~
   520        auth: ~
   521        options: {}
   522    -
   523        description: "tlsAllowInvalidCertificates=true and tlsDisableOCSPEndpointCheck=false raises an error"
   524        uri: "mongodb://example.com/?tlsAllowInvalidCertificates=true&tlsDisableOCSPEndpointCheck=false"
   525        valid: false
   526        warning: false
   527        hosts: ~
   528        auth: ~
   529        options: {}
   530    -
   531        description: "tlsAllowInvalidCertificates=false and tlsDisableOCSPEndpointCheck=true raises an error"
   532        uri: "mongodb://example.com/?tlsAllowInvalidCertificates=false&tlsDisableOCSPEndpointCheck=true"
   533        valid: false
   534        warning: false
   535        hosts: ~
   536        auth: ~
   537        options: {}
   538    -
   539        description: "tlsAllowInvalidCertificates and tlsDisableOCSPEndpointCheck both present (and false) raises an error"
   540        uri: "mongodb://example.com/?tlsAllowInvalidCertificates=false&tlsDisableOCSPEndpointCheck=false"
   541        valid: false
   542        warning: false
   543        hosts: ~
   544        auth: ~
   545        options: {}
   546    # 4 permutations of [tlsDisableOCSPEndpointCheck=true/false, tlsAllowInvalidCertificates=true/false]
   547    -
   548        description: "tlsDisableOCSPEndpointCheck and tlsAllowInvalidCertificates both present (and true) raises an error"
   549        uri: "mongodb://example.com/?tlsDisableOCSPEndpointCheck=true&tlsAllowInvalidCertificates=true"
   550        valid: false
   551        warning: false
   552        hosts: ~
   553        auth: ~
   554        options: {}
   555    -
   556        description: "tlsDisableOCSPEndpointCheck=true and tlsAllowInvalidCertificates=false raises an error"
   557        uri: "mongodb://example.com/?tlsDisableOCSPEndpointCheck=true&tlsAllowInvalidCertificates=false"
   558        valid: false
   559        warning: false
   560        hosts: ~
   561        auth: ~
   562        options: {}
   563    -
   564        description: "tlsDisableOCSPEndpointCheck=false and tlsAllowInvalidCertificates=true raises an error"
   565        uri: "mongodb://example.com/?tlsDisableOCSPEndpointCheck=false&tlsAllowInvalidCertificates=true"
   566        valid: false
   567        warning: false
   568        hosts: ~
   569        auth: ~
   570        options: {}
   571    -
   572        description: "tlsDisableOCSPEndpointCheck and tlsAllowInvalidCertificates both present (and false) raises an error"
   573        uri: "mongodb://example.com/?tlsDisableOCSPEndpointCheck=false&tlsAllowInvalidCertificates=false"
   574        valid: false
   575        warning: false
   576        hosts: ~
   577        auth: ~
   578        options: {}

View as plain text