HyperServer 中的 SSL 支持

HyperServer 中的 SSL 支持

DLL 模式不需要 SSL 配置, 因为 web 服务器 (如 IIS) 将承担 ssl 配置和 ssl 证书的责任。

对于独立和服务模式, ssl 配置是使用< server_name >. 。

下面是默认ssl. cfg文件的内容:

object TUniHyperSSL
SSL.Enabled = False
SSL.SSLOptions.RootCertFile = 'root.pem'
SSL.SSLOptions.CertFile = 'cert.pem'
SSL.SSLOptions.KeyFile = 'key.pem'
SSL.SSLOptions.Method = sslvTLSv1_1
SSL.SSLOptions.SSLVersions = [sslvTLSv1_1]
SSL.SSLOptions.Mode = sslmUnassigned
SSL.SSLOptions.VerifyMode = []
SSL.SSLOptions.VerifyDepth = 0
SSL.SSLPort = 0
end

您需要根据特定的 SSL 设置来配置以上参数。 您可能已经注意到, 上述格式与德尔菲的 DFM 文本格式相同。 实际上, 它是您的 ServerModule 的序列化SSL属性。

您需要做的就是打开 ServerModule 并将当前的 ssl 配置复制到ssl.cfg文件。

object UniServerModule: TUniServerModule
OldCreateOrder = False
TempFolder = 'temp\'
Title = 'New Application'
SuppressErrors = []
Bindings = <>

SSL.Enabled = True
SSL.SSLOptions.RootCertFile = 'root.pem'
SSL.SSLOptions.CertFile = 'cert.pem'
SSL.SSLOptions.KeyFile = 'key.pem'
SSL.SSLOptions.Method = sslvTLSv1_1
SSL.SSLOptions.SSLVersions = [sslvTLSv1_1]
SSL.SSLOptions.Mode = sslmUnassigned
SSL.SSLOptions.VerifyMode = []
SSL.SSLOptions.VerifyDepth = 0
SSL.SSLPassword = 'fmsoft'

ConnectionFailureRecovery.ErrorMessage = 'Connection Error'
ConnectionFailureRecovery.RetryMessage = 'Retrying...'
Height = 396
Width = 560
end

要更清楚地说明, 如果您已经有了现有的 SSL 安装程序, 只需打开项目的 ServerModule DFM文件, 并将所有与 ssl 相关的行复制到ssl.HyperServer 的cfg文件。

如果要配置新的 ssl 安装程序, 请创建一个新的 uniGUI 应用程序, 进行必要的 ssl 配置并对新设置进行完全测试。 在所有操作都将 ssl 行从 ServerModule 复制到ssl之后.cfg文件。

猜你喜欢

转载自www.cnblogs.com/hnxxcxg/p/9612599.html