swagger-codegen icon indicating copy to clipboard operation
swagger-codegen copied to clipboard

[JAVA] TLSv1.2 in ApiClient - swagger-codegen-maven-plugin with maven

Open favisan opened this issue 3 years ago • 3 comments

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>

favisan avatar Jul 26 '22 12:07 favisan

Hi! same problem. Somebody knows the answer for setting apiCliente with TLSv1.2?

lucaz248 avatar Oct 16 '23 14:10 lucaz248

I also wish for an answer on this matter. TLS 1.0 and 1.1 is not secure and I need TLS 1.2

Syrious avatar Jan 19 '24 06:01 Syrious

Found a solution and posted it on Stackoverflow

Syrious avatar Jan 19 '24 09:01 Syrious