swagger-codegen
swagger-codegen copied to clipboard
[JAVA] TLSv1.2 in ApiClient - swagger-codegen-maven-plugin with maven
Set TLS 1.2 in ApiClient
I'm trying to set TLSv1.2 protocol in ApiClient but I didn't find any key to set up in pom.xml. Is that configurable?
Swagger-codegen version
v.3.0.33 Java version: 11
Swagger declaration file content or url
ApiClient.java
...
private void applySslSettings() {
...
SSLContext sslContext = SSLContext.getInstance("TLS");
...
}
pom.xml:
<plugin>
<groupId>io.swagger.codegen.v3</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/admin.yaml</inputSpec>
<output>${generation.path}</output>
<language>java</language>
<addCompileSourceRoot>false</addCompileSourceRoot>
<generateApiTests>false</generateApiTests>
<generateApiDocumentation>false</generateApiDocumentation>
<generateModelTests>false</generateModelTests>
<generateModelDocumentation>false</generateModelDocumentation>
<configOptions>
<dateLibrary>joda</dateLibrary>
<modelPackage>${codegen.model}</modelPackage>
<apiPackage>${codegen.api}</apiPackage>
<configPackage>${codegen.configuration}</configPackage>
<basePackage>${codegen.base}</basePackage>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
Hi! same problem. Somebody knows the answer for setting apiCliente with TLSv1.2?
I also wish for an answer on this matter. TLS 1.0 and 1.1 is not secure and I need TLS 1.2
Found a solution and posted it on Stackoverflow