Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swagger CodeGen Https SSL Connectivity

I need to create swagger codegen client for java, javascript pointing to swagger yaml pusblished on https.

When tried below command got SSLHandshakeError.

"swagger-codegen generate -i https://localhost:443/api/swagger.yaml -l java -o java-api/."

Also when swagger codegen generates client will it have SSL Mutual TLS code for https swagger spec url?

Please help.

like image 341
erdarun Avatar asked Aug 25 '16 03:08

erdarun


1 Answers

Please add -D io.swagger.parser.util.RemoteUrl.trustAll=true when generating the code.

Ref: https://github.com/swagger-api/swagger-codegen/wiki/FAQ#is-there-a-way-to-disable-certificate-verification

UPDATE: On May 2018, about 50 top contributors and template creators of Swagger Codegen decided to fork Swagger Codegen to maintain a community-driven version called OpenAPI Generator. Please refer to the Q&A for more information.

like image 73
William Cheng Avatar answered Oct 21 '22 19:10

William Cheng