Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (中文) » UltraLiteJ » UltraLiteJ 参考 » UltraLiteJ API 参考

 

StreamHTTPSParms 接口

表示用于定义如何使用安全 HTTPS 与 MobiLink 服务器通信的 HTTPS 流参数。

语法
public StreamHTTPSParms
基类
注释

下面的示例将流参数设置为与主机名为 "MyMLHost" 的 MobiLink 11 服务器通信。使用以下参数启动该服务器:"-xo https(port=1234;certificate=RSAServer.crt;certificate_password=x)"

SyncParms syncParms = myConnection.createSyncParms(
    SyncParms.HTTPS,
    "MyUniqueMLUserID",
    "MyMLScriptVersion"
);
StreamHTTPSParms httpsParms =
    (StreamHTTPSParms) syncParms.getStreamParms();
httpsParms.setHost("MyMLHost");
httpsParms.setPort(1234);

上面的示例假设 RSAServer.crt 中的证书链接到已安装在客户端主机或设备上的受信任根证书。

对于 J2SE,可使用以下任一方法部署必需的受信任根证书:

1. 将受信任的根证书安装在 JRE 的 lib/security/cacerts 密钥存储区中。

2. 使用 Java keytool 实用程序构建自己的密钥存储区,并将 Java 系统属性 javax.net.ssl.trustStore 设置为该位置(将 javax.net.ssl.trustStorePassword 设置为适当值)。

3. 使用 setTrustedCertificates 函数参数指向部署的证书文件。

为增强安全性,应使用 setCertificateName、setCertificateCompany 或 setCertificateUnit 方法启用对 MobiLink 服务器证书的验证。

为 HTTPS 同步创建 SyncParms 类对象后,由 getStreamParms 函数返回实现此接口的实例。

成员

StreamHTTPSParms 的所有成员,包括所有继承的成员。


getCertificateCompany 方法
getCertificateName 方法
getCertificateUnit 方法
getTrustedCertificates 方法
setCertificateCompany 方法
setCertificateName 方法
setCertificateUnit 方法
setTrustedCertificates 方法