{
  "$schema": "file:///usr/local/lib/node_modules/@apica-io/url-xi/config/url-xi-schema-v1-0.json",
  "name": "Test Client with ssl certificates",
  "description": "The site is badssl.com",
  "baseURL": "https://badssl.com",
  "httpsAgent": {
    "rejectUnauthorized": true, 
    "key": "{{$cert.key_pem}}",
    "cert": "{{$cert.cert_pem}}"
   
  },
  "includes": [
    {
      "name": "key_pem",
      "type": "certificate",
      "scope": "project",
      "src": "file.key.pem"
    },
    {
      "name": "cert_pem",
      "type": "certificate",
      "scope": "project",
      "src": "file.cert.pem"
    }
  ],
  "steps": [
    {
      "name": "Client pages",
     
      "requests": [
        {
          "name":"Client",
          "config":{
            "url": "https://client.badssl.com",
            "method": "get"
          },
          "extractors": [
            {
              "type": "regexp",
              "expression": "(Client-authenticated_TLS_handshake)",
              "variable": "responseValidation"
            }
          ],
          "assertions": [
            {
              "type": "javaScript",
              "value": "{{responseValidation}}",
              "description": "Html body must contain Client-authenticated",
              "expression": "value.length >0 ",
              "failStep": true,
              "reportFailOnly": false
            }
          ]
        },
        {
          "name":"Client Cert Missing",
          "config":{
            "url": "https://client-cert-missing.badssl.com/"
          },
          "expectedStatus": [400],
          "extractors": [
            {
              "type": "regexp",
              "expression": "<title>400 The SSL certificate error</title>",
              "variable": "responseValidation"
            }
          ],
          "assertions": [
            {
              "type": "javaScript",
              "value": "{{responseValidation}}",
              "description": "Html title must contain SSL certificate error",
              "expression": "value.length > 0 ",
              "failStep": true,
              "reportFailOnly": false
            }
          ]
        
        }

      ]
    }
  ]
}