[ 
https://issues.apache.org/jira/browse/CAMEL-16059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17272945#comment-17272945
 ] 

Gianpaolo Lopresti edited comment on CAMEL-16059 at 1/27/21, 3:48 PM:
----------------------------------------------------------------------

Hi [~davsclaus],

i've tried both solutions, none of them work...

Example: i've created this class:

{code:java}
@Configuration
public class CamelBeans {

    @Bean
    @Qualifier("noopHostnameVerifier")
    public HostnameVerifier noopHostnameVerifier() {
        return NoopHostnameVerifier.INSTANCE;
    }
}
{code}
 
and put this inside application.yaml:
{code}
camel:
  component:
    http:
      x509-hostname-verifier: noopHostnameVerifier
{code}

but when the app starts it crashes with this message:

{code}
Failed to bind properties under 'camel.component.http.x509-hostname-verifier' 
to javax.net.ssl.HostnameVerifier:

    Property: camel.component.http.x509-hostname-verifier
    Value: noopHostnameVerifier
    Origin: class path resource [config/application.yml] - 71:30
    Reason: No converter found capable of converting from type 
[java.lang.String] to type [javax.net.ssl.HostnameVerifier]
{code}

Please note that if i use Camel 3.2.0 with Spring Boot 2.2.6.RELEASE it works 
with the option
x509-hostname-verifier: NoopHostnameVerifier (that i've taken from 
documentation).

Thanks,
best regards.



was (Author: gilo):
Hi [~davsclaus],

i've tried both solutions, none of them work...

Example: i've created this class:

{code:java}
@Configuration
public class CamelBeans {

    @Bean
    @Qualifier("noopHostnameVerifier")
    public HostnameVerifier noopHostnameVerifier() {
        return NoopHostnameVerifier.INSTANCE;
    }
}
{code}
 
and put this inside application.yaml:
{code}
camel:
  component:
    http:
      x509-hostname-verifier: noopHostnameVerifier
{code}

but when the app starts it crashes with this message:

{code}
Failed to bind properties under 'camel.component.http.x509-hostname-verifier' 
to javax.net.ssl.HostnameVerifier:

    Property: camel.component.http.x509-hostname-verifier
    Value: 
    Origin: class path resource [config/application.yml] - 71:30
    Reason: No converter found capable of converting from type 
[java.lang.String] to type [javax.net.ssl.HostnameVerifier]
{code}

Please note that if i use Camel 3.2.0 with Spring Boot 2.2.6.RELEASE it works 
with the option
x509-hostname-verifier: NoopHostnameVerifier (that i've taken from 
documentation).

Thanks,
best regards.


> Cannot configure x509 host name verifier on camel http component
> ----------------------------------------------------------------
>
>                 Key: CAMEL-16059
>                 URL: https://issues.apache.org/jira/browse/CAMEL-16059
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-http
>    Affects Versions: 3.7.0
>            Reporter: Gianpaolo Lopresti
>            Priority: Major
>
> Hi,
> When using camel-http-starter (with Spring boot), if you try to set the 
> property (as per 
> https://camel.apache.org/camel-spring-boot/latest/http-starter.html):
> camel.component.http.x509-hostname-verifier = NoopHostnameVerifier
> Camel crashes at start up with the message:
>  
> Failed to bind properties under 'camel.component.http.x509-hostname-verifier' 
> to javax.net.ssl.HostnameVerifier:
> Property: camel.component.http.x509-hostname-verifier
>  Value: NoopHostnameVerifier
>  Origin: class path resource [config/application.yml] - 71:31
>  Reason: No converter found capable of converting from type 
> [java.lang.String] to type [javax.net.ssl.HostnameVerifier]
>  
> Thanks.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to