wso2isbest
wso2isbest

Reputation: 85

Why WSO2 API Manager gives Hostname verification failed while getting the token?

I have one WSO2 Identity server running on docker container and My API-Manager is configured to use it as key manager. API Manager is also running on docker.

When Iam Trying to get a token in Postman, I call this https://myhost.com:8243/token?grant_type=client_credentials with base64 encoded "client_id:secret" it gives me this exception:

[2021-04-27 17:13:21,704] ERROR - TargetHandler I/O error: Host name verification failed for host : is.com javax.net.ssl.SSLException: Host name verification failed for host : is.com

Also the [apim.key_manager] is configured like this:

[apim.key_manager]
service_url = "https://is.com:9442/services/"
username = "$ref{super_admin.username}"
password = "$ref{super_admin.password}"
type = "WSO2-IS"

"is.com" is the domain for my identity server container.

I dont know why is this happening and HostNameVerification is disabled in apim.

How can I fix it?

Thank you.

Upvotes: 1

Views: 789

Answers (1)

Pubci
Pubci

Reputation: 4001

I guess you haven't disabled hostname verification in Synapse level. This can be done using the following config in the deployment.toml

[transport.passthru_https.sender.parameters]
HostnameVerifier = "AllowAll"

The recommended approach is to use the correct hostname. For this, you can use a DNS entry.

Upvotes: 4

Related Questions