2014-02-17 4 views
0

Apache Commons VFS를 사용하여 http://openexchangerates.org API에서 데이터를 가져 오려고합니다. SSL 유효성 검사를 사용하려고한다는 의미의 오류가 발생합니다. 웹 사이트 계획을 통해 사용할 수있는 것이 아닙니다. VFS가 https 대신 http를 사용하도록 강제 할 수있는 방법이 있습니까? 거대한 스택 추적의Apache Commons VFS에서 SSL을 사용하지 못하도록 막으십시오.

관련 사항은 아래에 포함되어 있습니다 - 필요한 경우 추가 정보를 제공 할 수 있습니다

org.apache.commons.vfs2.VFS.getManager().resolveFile("http://openexchangerates.org/api/latest.json?api_id=MY_APP_ID") 
org.apache.commons.vfs2.FileSystemException: Could not connect to HTTP server on "openexchangerates.org". 

Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target 

Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target 

Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target 

답변

1

웹 사이트는 HTTPS 버전으로 리디렉션합니다. 따라서 http를 지원하지 않습니다. http 클라이언트는이 리디렉션을 자동으로 따르며 적절한 확인을 위해 구성해야합니다. 설명에 대한

$ curl -v http://openexchangerates.org/api/latest.json?api_id=MY_APP_ID 
* Connected to openexchangerates.org (185.24.96.251) port 80 (#0) 
> GET /api/latest.json?api_id=MY_APP_ID HTTP/1.1 
> User-Agent: curl/7.30.0 
> Host: openexchangerates.org 
> Accept: */* 

< HTTP/1.1 301 Moved Permanently 
< Date: Mon, 05 Jan 2015 23:37:18 GMT 
< Server: Apache 
< Location: https://openexchangerates.org?missing_app_id=true 
+0

감사 : 여기

내가 이것을 확인하는 방법입니다! – Serenthia