swagger-api / swagger-api/swagger-codegen
[JAVA] TLSv1.2 in ApiClient - swagger-codegen-maven-plugin with maven
Open
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
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>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the generated ApiClient.java and its applySslSettings method, then compare it with the swagger-codegen-maven-plugin configuration in pom.xml. Check how SSLContext is created and determine how TLSv1.2 should be made configurable; done means the generated client can use the requested protocol through the Maven configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100