在基于IBM Domino的应用程序中,我们将使用REST API与系统集成。
但是,最近我们遇到了一个似乎很难解决的问题。
在发送请求时,我们收到以下异常
Error while executing JavaScript action expression
Script interpreter error,line=14,col=32: Error calling method 'initializeAuthProcess(string,string)' on java class 'ru.iteko.egrz.requestprocessors.EGRZAuthorization'
com.ibm.jsse2.util.h: No trusted certificate found
No trusted certificate found
之所以如此尴尬,是因为缺乏文档以及任何有关此类情况发生的指南。
因此,像这样的按钮上都有点击动作
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete">
<xp:this.action><![CDATA[#{javascript:
var redirectUrl = 'https://oursystem.ru';
var errorRedirectUrl = 'https://oursystem.ru/errorPage';
var EGRZAuthObject = new ru.iteko.egrz.requestprocessors.EGRZAuthorization();
EGRZAuthObject.initializeAuthProcess(redirectUrl,errorRedirectUrl);
}]]></xp:this.action>
</xp:eventHandler>
在EGRZAuthorization类的实例中,有以下称为
的方法public static void initializeAuthProcess(String redirectUrl,String apiRedirectUrl) throws Clientprotocolexception,IOException
{
CloseableHttpClient httpclient = HttpClients.createDefault();
String urlToGoTo = AuthURLs.ESIALoginURL(redirectUrl,apiRedirectUrl);
System.out.println(urlToGoTo);
HttpGet httpGet = new HttpGet(urlToGoTo);
CloseableHttpResponse response1 = httpclient.execute(httpGet);
System.out.println("resp code " + response1.getStatusLine());
response1.close();
}
在执行请求的地方发生异常。
Stacktrace:
com.ibm.jsse2.util.h: No trusted certificate found
com.ibm.jsse2.util.g.a(g.java:183)
com.ibm.jsse2.util.g.b(g.java:43)
com.ibm.jsse2.util.e.a(e.java:4)
com.ibm.jsse2.aB.a(aB.java:211)
com.ibm.jsse2.aB.a(aB.java:5)
com.ibm.jsse2.aB.checkServerTrusted(aB.java:49)
com.ibm.jsse2.E.a(E.java:166)
com.ibm.jsse2.E.a(E.java:121)
com.ibm.jsse2.D.r(D.java:223)
com.ibm.jsse2.D.a(D.java:198)
com.ibm.jsse2.at.a(at.java:649)
com.ibm.jsse2.at.i(at.java:627)
com.ibm.jsse2.at.a(at.java:689)
com.ibm.jsse2.at.startHandshake(at.java:432)
org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:436)
org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectsocket(SSLConnectionSocketFactory.java:384)
org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
org.apache.http.impl.conn.PoolingHttpClientConnectionmanager.connect(PoolingHttpClientConnectionmanager.java:374)
org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
ru.iteko.egrz.requestprocessors.EGRZAuthorization.initializeAuthProcess(EGRZAuthorization.java:32)
这是最聪明的地方。 urlToGoTo
变量等于http://lk.egrz-test.i-teco.ru/fws/api/esia/login?errorRedirectUrl=https://oursystem.ru/errorPage&redirectUrl=https://oursystem.ru
其作用是将用户重定向到外部资源以进行授权。
在这里总结一下一切:
- 我们将GET请求发送到
urlToGoTo
- 然后该服务将我们重定向到使用HTTPS的资源(如果有关系的话)
但是我们什至看不到它,因为得到上面的异常。该请求根本没有执行。
我们已经安装了所需的证书(外部源,auth,HTTPS,最后重定向到该证书)并进行了交叉认证。但是仍然没有运气。
我希望有任何解决方案,请帮助。我个人不知道为什么会这样。
预先感谢