1

I'm trying to test one of our servers with this test.
We are using Nginx with multiple TLS certificates configured (so nginx will use SNI header to identify proper Vhost to use).
But I got an error from default Vhost.
I need this test case because I want to go directly on load-balancer without DNS resolution inplace.

  Scenario: test case
    Given url 'https://1.2.3.4/check'
    And header Host = 'real-host-header'
    When method get
    Then status 200

How I can specify TLS SNI header for this request?

Alex Nor
  • 11
  • 1

1 Answers1

0

I don't think this is directly supported, we simply use the Apache HttpClient and that dictates how this is handled.

This sounds to me an area where you can contribute to Karate, no one has asked for this yet. Actually can you see if this is somewhat solved by configure localAddress which we introduced recently, you can find details here: https://github.com/intuit/karate/tree/master/karate-gatling#configure-localaddress

The commit for the above feature is here, so you can use it as a reference to add a capability that the Apache HttpClient supports: https://github.com/intuit/karate/commit/1b39f26622c482757464888682330ab425db83a0

I found this other Stack Overflow that can be used as a reference, but it wasn't clear to me at a quick glance if such a header can be manually specified: https://stackoverflow.com/a/25864756/143475

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248