K
K
Konstantin17062020-05-14 19:24:19
Spring
Konstantin1706, 2020-05-14 19:24:19

How to pass key and certificate to swagger-ui?

There is an application on Spring Boot. Connected swagger (springfox). For it to work properly on my stand, I need to transfer the key and certificate.

If I use curl, then the request looks like:

curl --key /opt/1.key --cert /opt/2.crt https://www.website.com:8000/

works without errors. But I can't pass such parameters as: --key, --cert via swagger.

Tried to customize requests:
new Docket(...)
        .globalOperationParameters(
    Arrays.asList(new ParameterBuilder()
        .name("header")
        .description("Description of header")
        .modelRef(new ModelRef("string"))
        .parameterType("header")
        .required(true)
        .build()))

But in parameterType it is impossible to add what I need. Its parameters are:
path parameters,   пример /users/{id}
query parameters,  пример /users?role=admin
header parameters, пример X-MyHeader: Value
cookie parameters, пример Cookie: debug=0

How all the same to transfer --key, --cert?

Thank you.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question