Publishing Web services encrypted by HTTPS |
Both iServer and iEdge support publishing third-party Web services encrypted over HTTPS as WMS , WMTS, REST, and WFS service types, and the iServer Web Printing service supports printing Web services encrypted over HTTPS. There are two situations encountered when iServer and iEdge agents publish and use HTTPS services:
If the SSL certificate used by the HTTPS server is authenticated by an authority, the corresponding client certificate is already built into Java, so the iServer and iEdge agents publish and use third-party HTTPS services without any configuration.
If the SSL certificate used by the HTTPS server is not authenticated by an authoritative institution, the client certificate that verifies the identity of this HTTPS server will be missing in Java. Therefore, it is necessary to first generate a client certificate in the HTTPS server, and then provide the generated client certificate to iServer and iEdge for use. In iServer (iEdge is the same as iServer), simply import the client certificate correctly and fill in the HTTPS service address to successfully publish and use third-party web services encrypted with HTTPS.
kkeytool -genkey -alias tomcat -keyalg RSA -dname "cn=supermap.iserver.org,ou=localhost,o=localhost,l=china,st=sichuan,c=cn" -keystore D:\key.keystore
keytool -export -alias tomcat -keystore D:\key.keystore -rfc -file D:/supermap.cer
keytool -export -alias tomcat -keystore D:\key.keystore -rfc -file D:/supermap.cer
On the iServer server, modify the catalina.bat file under the %SuperMap iServer_HOME%/bin directory , which adds the client certificate (key.truststore) to the iServer, authenticates the HTTPS server. The specific amendments are as follows:
Before modification, it is as follows:
set JAVA_OPTS=%JAVA_OPTS% -Xms256m -Xmx1536m -XX:MaxPermSize=192m -Xss512k
The modification is as follows:
set JAVA_OPTS=%JAVA_OPTS% -Xms256m -Xmx512m -XX:MaxPermSize=192m -Xss512k -Djavax.net.ssl.trustStore=D:/key.truststore -Djavax.net.ssl.trustStoreType=JKS -Djavax.net.ssl.trustStorePassword=123456
When filling in the HTTPS service address to be forwarded in iServer and iEdge, the HTTPS service address should be in the form of domain name (i.e. The domain name of the HTTPS server, such as https://supermap.iserver.org:8443/iserver/services/map-china400/rest).