[ad_1]
I’m working on microservices using spring cloud gateway to centralize all the requests, and then I changed to use https. Untill now everything is working greate I created my self signed certificate and used it in evey microservice and made a test of sending GET,POST,DELETE to evey micro and everything is greate, and then the problem comes in when I tried to send http requests to the micros via the spring cloud gateway it displays this Bad Request This combination of host and port requires TLS.
I generated my certificate with this command:
keytool -genkeypair -alias statement -keystore src/main/resources/statement-keystore.p12 -keypass secret -storeType PKCS12 -storepass secret -keyalg RSA -keysize 2048 -validity 365 -dname "C=MA, ST=ST, L=L, O=statement, OU=statement, CN=localhost" -ext "SAN=dns:localhost"
spring cloud gateway app.yml:
server:
port: 8765
ssl:
enabled: true
key-alias: statement
key-store: classpath:statement-keystore.p12
key-store-password: secret
key-store-type: PKCS12
example:
I have one micro running on port 8081
so if I test GET request like this https://localhost:8081/api/v1/statemnts
it returns 200 and displays the data, but if I try with spring cloud port https://localhost:8765/api/v1/statemnts
this returns This combination of host and port requires TLS.
PS:
- I’m using zipkin and rabbitmq as tracing system using http.
- I uploaded my certificate to postman even that the problem occurs.
- This is happening in both postman and browser
- If any other details needed I’ll add more
Thanks in advance.
[ad_2]