如何在加特林项目中禁用SSL证书检查?

问题描述

我有如下代码

class BasicSimulation extends Simulation {
  val Feeder = csv("PerfData.csv").random
  val httpProtocol = http
    .baseUrl(System.getProperty("ServiceUrl"))
  System.setProperty("gatling.http.ahc.uSEOpenSsl","false");

  val scn = scenario("Track Doc Ingestion service").Feed(Feeder)
    .exec(http("Default Request")
    .post("/trackdocs").header("content-encoding","gzip").body(RawFileBody("track-12b1190f-fa5f-4c7e-b328-39c1e250aa51.xml.gzip")).check(status.is(200)))


  setUp(scn.inject(constantUsersPerSec(Integer.parseInt(System.getProperty("users"))) during (Integer.parseInt(System.getProperty("duration")))).protocols(httpProtocol))

运行此命令时,我遇到错误

 [gatling-http-1-2][WARN ][StatsProcessor.scala:84] i.g.h.e.r.DefaultStatsProcessor - Request 'query Request' Failed for user 1: status.find.is(200),but actually found 500
Session(Track Doc api service querying,1,1599167198666,Map(gatling.http.cache.baseUrl -> https://localhost:48080,gatling.http.cache.dns -> io.gatling.http.cache.DnsCacheSupport$$anon$1@5b147857,accountId -> L1TL1N,gatling.http.ssl.sslContexts -> SslContexts(io.netty.handler.ssl.JdkSslContext@35ce16a9,None),executionId -> execution-asasas2-efc2b531e69a-2020.09.03),31,KO,List(),io.gatling.core.protocol.ProtocolComponentsRegistry$$Lambda$558/0x00000001005f1040@29c99b9e)

我该如何解决

解决方法

用户1的请求“查询请求”失败:status.find.is(200),但实际上找到了500

您将收到状态码为500的回复。这与SSL证书验证完全无关。