如何使用 Docker 配置 SAP SNC

Posted

技术标签:

【中文标题】如何使用 Docker 配置 SAP SNC【英文标题】:How to configure SAP SNC using Docker 【发布时间】:2021-07-26 18:18:01 【问题描述】:

我需要将与 SAP 系统对话的服务容器化。该服务是使用 Spring Boot 编写的。

我有一个文档可以在 Linux 机器上手动执行步骤,这将有助于连接到 SAP 系统。它遵循的步骤是:

    下载所需文件 切换到用户 解压这些文件 创建符号链接 准备证书和密钥 生成 PSE 将 SAP 根证书和中间证书添加到 PSE 等等。

我正在考虑编写一个包含上述所有步骤的 Dockerfile。暂时不知道有什么其他的选择。

几个查询:

    编写一个包含我们手动执行任何 Linux 机器的所有步骤的 Dockerfile 是否是个好主意,这也将帮助我将与 SAP 系统对话的服务容器化。 是否有任何其他替代方案或库可用于实现相同目标。 Docker 文件是否已经存在,这将帮助我连接到 SAP 系统。 如何使用 Dockerfile 在我的应用程序中配置 SAP SNC。

有人可以帮我吗?

感谢您的所有帮助!提前致谢!

【问题讨论】:

1.为什么不? 2. 什么替代品? 3. AFAIK 没有。 4 仅从零开始step-by-step 定义dockerfile或Docker Compose中的所有配置步骤 非常感谢 Suncatcher 的回复和分享信息。从头开始编写 Dockerfile 的替代方案。我应该继续使用 dockerfile 逐步定义所有配置步骤吗? 恐怕是的,你应该这样做。我不知道 SNC 的 OOTB 解决方案。 什么是 OOTB 解决方案?另外,我可以发布我的 Dockerfile 解决方案吗?请您查看一下。 OOTB = 开箱即用 【参考方案1】:

如果您有一个基于 Java 的 Spring 应用程序,您可以使用SAP Jco library,它可用于从外部连接到 SAP 系统。配置步骤如下所述:

https://help.mulesoft.com/s/article/Enabling-SNC-in-SAP-connector

它在 Mulesoft 帮助中给出,但要点对于任何基于 Java 的系统都是相同的。

SNC需要设置的最重要的JCo参数:

Parameter Name Description
jco.client.snc_mode SNC mode 1: SNC is activated 0: SNC is not activated
jco.client.snc_lib SNC library path Specifies the path and file name of the external library. The default is the system-defined library as defined in the environment variable SNC_LIB. Example: C:SAP\J2EE_Engine\SAPCrypto\libs\apcrypto.dll
jco.client.snc_qop SNC level Specifies the level of protection to use for the connection. 1: Authentication only 2: Integrity protection 3: Privacy protection (default) 8: Use the value from snc/data protection/use on the SAP application server 9: Use the value from snc/data_protection/max on the SAP application server
jco.client.snc_myname SNC name Specifies the SNC name. This parameter should be set to ensure that the correct SNC name is used for the connection. Example: p:CN=SAPJ2EE, O=MyCompany, C=US
jco.client.snc_partnername SNC partner Specifies the SAP application server's SNC name. It can be found in the SAP profile parameter snc\identity\as. Example: p:CN=ABC, O=MyCompany, C=US

【讨论】:

是的,我有一个基于 Java 的 Spring 应用程序,它从外部连接到 SAP 系统。但是,我需要将这个 Spring Boot 应用程序容器化。我想知道一旦我编写了一个包含运行简单 Java 应用程序的命令的 Dockerfile,它将如何从外部连接到 SAP?我应该在 Dockerfile(JCO 库及其相关参数)中包含这些配置吗? 这个问题更适合 Docker 专业人士,我不熟悉这里的最佳实践 非常感谢 Suncatcher 抽出宝贵时间分享所有信息。 如果你觉得有用就给点赞吧

以上是关于如何使用 Docker 配置 SAP SNC的主要内容,如果未能解决你的问题,请参考以下文章