通过HTTPS打开旅行计划器GTFSRT

问题描述

我已成功使用开放数据成功部署了otp服务器。我目前正在使用.pb文件作为数据源(放置在除otp以外的其他域上)实时,并且已经按照指南配置了router-config.json:

https://docs.opentripplanner.org/en/latest/Configuration/#real-time-data

所以在更新程序中,我有类似的东西:

        {
            "type": "real-time-alerts","frequencySec": 30,"url": "http://example.com/download/gtfs/",}

如果我将HTTP网址替换为https,则会出现问题。在这种情况下,我会看到以下错误

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException:                                                                                                              PKIX path building Failed: sun.security.provider.certpath.SunCertPathBuilderExce                                                                                                             ption: unable to find valid certification path to requested target
        at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) ~[na:1.8.0_2                                                                                                             22]
        at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1946) ~[na:1.                                                                                                             8.0_222]
        at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:316) ~[na:1.8.0_2                                                                                                             22]
        at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:310) ~[na:1.8.0_2                                                                                                             22]
        at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.                                                                                                             java:1639) ~[na:1.8.0_222]
        at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.jav                                                                                                             a:223) ~[na:1.8.0_222]
        at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1037) ~[na:1.                                                                                                             8.0_222]
        at sun.security.ssl.Handshaker.process_record(Handshaker.java:965) ~[na:                                                                                                             1.8.0_222]
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1064) ~[                                                                                                             na:1.8.0_222]
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.                                                                                                             java:1367) ~[na:1.8.0_222]
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1395                                                                                                             ) ~[na:1.8.0_222]
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1379                                                                                                             ) ~[na:1.8.0_222]
        at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createlayeredSock                                                                                                             et(SSLConnectionSocketFactory.java:396) ~[otp.jar:1.1]
        at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSL                                                                                                             ConnectionSocketFactory.java:355) ~[otp.jar:1.1]
        at org.apache.http.impl.conn.DefaultHttpClientConnectionoperator.connect                                                                                                             (DefaultHttpClientConnectionoperator.java:142) ~[otp.jar:1.1]
        at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(                                                                                                             PoolingHttpClientConnectionManager.java:373) ~[otp.jar:1.1]
        at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClie                                                                                                             ntExec.java:381) ~[otp.jar:1.1]
        at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.                                                                                                             java:237) ~[otp.jar:1.1]
        at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java                                                                                                             :185) ~[otp.jar:1.1]
        at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) ~                                                                                                             [otp.jar:1.1]
        at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java                                                                                                             :111) ~[otp.jar:1.1]
        at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttp                                                                                                             Client.java:185) ~[otp.jar:1.1]
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttp                                                                                                             Client.java:83) ~[otp.jar:1.1]
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttp                                                                                                             Client.java:108) ~[otp.jar:1.1]
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttp                                                                                                             Client.java:56) ~[otp.jar:1.1]
        at org.opentripplanner.util.HttpUtils.getData(HttpUtils.java:46) ~[otp.j                                                                                                             ar:1.1]
        at org.opentripplanner.util.HttpUtils.getData(HttpUtils.java:37) ~[otp.j                                                                                                             ar:1.1]
        at org.opentripplanner.updater.alerts.GtfsRealtimeAlertsUpdater.runPolli                                                                                                             ng(GtfsRealtimeAlertsUpdater.java:101) ~[otp.jar:1.1]
        at org.opentripplanner.updater.PollingGraphUpdater.run(PollingGraphUpdat                                                                                                             er.java:60) [otp.jar:1.1]
        at org.opentripplanner.updater.GraphUpdaterManager.lambda$startUpdaters$                                                                                                             1(GraphUpdaterManager.java:175) [otp.jar:1.1]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.                                                                                                             java:1149) ~[na:1.8.0_222]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor                                                                                                             .java:624) ~[na:1.8.0_222]
        at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_222]
Caused by: sun.security.validator.ValidatorException: PKIX path building Failed:                                                                                                              sun.security.provider.certpath.SunCertPathBuilderException: unable to find vali                                                                                                             d certification path to requested target
        at sun.security.validator.PKIXValidator.dobuild(PKIXValidator.java:397)                                                                                                              ~[na:1.8.0_222]
        at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.jav                                                                                                             a:302) ~[na:1.8.0_222]
        at sun.security.validator.Validator.validate(Validator.java:262) ~[na:1.                                                                                                             8.0_222]
        at sun.security.ssl.x509trustmanagerImpl.validate(x509trustmanagerImpl.j                                                                                                             ava:330) ~[na:1.8.0_222]
        at sun.security.ssl.x509trustmanagerImpl.checkTrusted(x509trustmanagerIm                                                                                                             pl.java:237) ~[na:1.8.0_222]
        at sun.security.ssl.x509trustmanagerImpl.checkServerTrusted(X509TrustMan                                                                                                             agerImpl.java:132) ~[na:1.8.0_222]
        at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.                                                                                                             java:1621) ~[na:1.8.0_222]
        ... 28 common frames omitted
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to                                                                                                              find valid certification path to requested target
        at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBu                                                                                                             ilder.java:141) ~[na:1.8.0_222]
        at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCert                                                                                                             PathBuilder.java:126) ~[na:1.8.0_222]
        at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280) ~[                                                                                                             na:1.8.0_222]
        at sun.security.validator.PKIXValidator.dobuild(PKIXValidator.java:392)                                                                                                              ~[na:1.8.0_222]
        ... 34 common frames omitted
WARN (GtfsRealtimeHttpTripUpdateSource.java:88) Failed to parse gtfs                                                                                                             s-rt Feed from https://example.com/download/gtfs/:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException:                                                                                                              PKIX path building Failed: sun.security.provider.certpath.SunCertPathBuilderExce                                                                                                             ption: unable to find valid certification path to requested target
        at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) ~[na:1.8.0_2                                                                                                             22]
        at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1946) ~[na:1.                                                                                                             8.0_222]
        at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:316) ~[na:1.8.0_2                                                                                                             22]
        at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:310) ~[na:1.8.0_2                                                                                                             22]
        at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.                                                                                                             java:1639) ~[na:1.8.0_222]
        at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.jav                                                                                                             a:223) ~[na:1.8.0_222]
        at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1037) ~[na:1.                                                                                                             8.0_222]
        at sun.security.ssl.Handshaker.process_record(Handshaker.java:965) ~[na:                                                                                                             1.8.0_222]
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1064) ~[                                                                                                             na:1.8.0_222]
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.                                                                                                             java:1367) ~[na:1.8.0_222]
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1395                                                                                                             ) ~[na:1.8.0_222]
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1379                                                                                                             ) ~[na:1.8.0_222]
        at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createlayeredSock                                                                                                             et(SSLConnectionSocketFactory.java:396) ~[otp.jar:1.1]
        at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSL                                                                                                             ConnectionSocketFactory.java:355) ~[otp.jar:1.1]
        at org.apache.http.impl.conn.DefaultHttpClientConnectionoperator.connect                                                                                                             (DefaultHttpClientConnectionoperator.java:142) ~[otp.jar:1.1]
        at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(                                                                                                             PoolingHttpClientConnectionManager.java:373) ~[otp.jar:1.1]
        at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClie                                                                                                             ntExec.java:381) ~[otp.jar:1.1]
        at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.                                                                                                             java:237) ~[otp.jar:1.1]
        at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java                                                                                                             :185) ~[otp.jar:1.1]
        at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) ~                                                                                                             [otp.jar:1.1]
        at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java                                                                                                             :111) ~[otp.jar:1.1]
        at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttp                                                                                                             Client.java:185) ~[otp.jar:1.1]
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttp                                                                                                             Client.java:83) ~[otp.jar:1.1]
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttp                                                                                                             Client.java:108) ~[otp.jar:1.1]
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttp                                                                                                             Client.java:56) ~[otp.jar:1.1]
        at org.opentripplanner.util.HttpUtils.getData(HttpUtils.java:46) ~[otp.j                                                                                                             ar:1.1]
        at org.opentripplanner.util.HttpUtils.getData(HttpUtils.java:37) ~[otp.j                                                                                                             ar:1.1]
        at org.opentripplanner.updater.stoptime.GtfsRealtimeHttpTripUpdateSource                                                                                                             .getUpdates(GtfsRealtimeHttpTripUpdateSource.java:67) ~[otp.jar:1.1]
        at org.opentripplanner.updater.stoptime.PollingStoptimeUpdater.runPollin                                                                                                             g(PollingStoptimeUpdater.java:152) [otp.jar:1.1]
        at org.opentripplanner.updater.PollingGraphUpdater.run(PollingGraphUpdat                                                                                                             er.java:60) [otp.jar:1.1]
        at org.opentripplanner.updater.GraphUpdaterManager.lambda$startUpdaters$                                                                                                             1(GraphUpdaterManager.java:175) [otp.jar:1.1]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.                                                                                                             java:1149) ~[na:1.8.0_222]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor                                                                                                             .java:624) ~[na:1.8.0_222]
        at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_222]
Caused by: sun.security.validator.ValidatorException: PKIX path building Failed:                                                                                                              sun.security.provider.certpath.SunCertPathBuilderException: unable to find vali                                                                                                             d certification path to requested target
        at sun.security.validator.PKIXValidator.dobuild(PKIXValidator.java:397)                                                                                                              ~[na:1.8.0_222]
        at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.jav                                                                                                             a:302) ~[na:1.8.0_222]
        at sun.security.validator.Validator.validate(Validator.java:262) ~[na:1.                                                                                                             8.0_222]
        at sun.security.ssl.x509trustmanagerImpl.validate(x509trustmanagerImpl.j                                                                                                             ava:330) ~[na:1.8.0_222]
        at sun.security.ssl.x509trustmanagerImpl.checkTrusted(x509trustmanagerIm                                                                                                             pl.java:237) ~[na:1.8.0_222]
        at sun.security.ssl.x509trustmanagerImpl.checkServerTrusted(X509TrustMan                                                                                                             agerImpl.java:132) ~[na:1.8.0_222]
        at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.                                                                                                             java:1621) ~[na:1.8.0_222]
        ... 29 common frames omitted
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to                                                                                                              find valid certification path to requested target
        at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBu                                                                                                             ilder.java:141) ~[na:1.8.0_222]
        at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCert                                                                                                             PathBuilder.java:126) ~[na:1.8.0_222]
        at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280) ~[                                                                                                             na:1.8.0_222]
        at sun.security.validator.PKIXValidator.dobuild(PKIXValidator.java:392)                                                                                                              ~[na:1.8.0_222]
        ... 35 common frames omitted

我试图在otp服务器上安装ssl证书,以便它们可以交换证书,但变化不大。现在,我将尝试在otp的域上创建一个别名,以使两个站点将自己视为相同的域。但是,您是否知道我做错了什么还是一切正确? 我开始发现otp无法处理https,导致指南说:

可以使用拉或推系统提供实时数据。在拉式配置中,GTFS-RT使用者通过HTTP轮询实时提供程序

它从不说https(尽管示例中有一个自行车的https链接

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)