简体   繁体   English

Bluemix Secure Gateway JDBC与MySQL数据库的连接

[英]Bluemix Secure Gateway JDBC connection to MySQL database

I managed to create a connection from my sample Java application running on Bluemix and a MySQL database running on my local machine using Secure Gateway service and Docker. 我设法使用Secure Gateway服务和Docker通过在Bluemix上运行的示例Java应用程序和在本地计算机上运行的MySQL数据库创建了连接。 No security. 没有安全感。

Now I am trying to find out how should TLS be configured. 现在,我试图找出应该如何配置TLS。 Should I establish the TLS connection in my Java code and make the corresponding configuration in MySQL? 是否应该在Java代码中建立TLS连接并在MySQL中进行相应的配置? I thought this would be a configuration between Secure Gateway and Docker. 我以为这是Secure Gateway和Docker之间的配置。 If this is the case, how should I configure the communication between them? 在这种情况下,如何配置它们之间的通信? And, what is the token required for? 而且,所需的令牌是什么?

Is there a tutorial on how to implement this communication in Java? 是否有关于如何在Java中实现此通信的教程?

Thanks in advance. 提前致谢。

TLS can be configured between your java app and the Secure Gateway Cloud host and port and between the Docker client and your MySQL database. 可以在Java应用程序与Secure Gateway Cloud主机和端口之间以及Docker客户端与MySQL数据库之间配置TLS。 These are done separately. 这些分别完成。

Docs for these two configurations: 这两个配置的文档:

Application side TLS: https://www.ng.bluemix.net/docs/services/SecureGateway/sg_023.html#sg_007 应用程序端TLS: https : //www.ng.bluemix.net/docs/services/SecureGateway/sg_023.html#sg_007

Client side TLS: https://www.ng.bluemix.net/docs/services/SecureGateway/sg_023.html#sg_011 客户端TLS: https : //www.ng.bluemix.net/docs/services/SecureGateway/sg_023.html#sg_011

The traffic through the tunnel between the docker client and the secure gateway server is always encrypted, there are no options around this. 通过Docker客户端和安全网关服务器之间的隧道的通信始终是加密的,对此没有任何选择。

For security reasons, it is best to use TLS on the application side. 出于安全原因,最好在应用程序端使用TLS。 This would require your Java app to connect with the Secure Gateway cloud host:port using TLS. 这将要求您的Java应用程序使用TLS与Secure Gateway云host:port连接。 I don't have a tutorial for this in Java. 我没有Java的相关教程。

The security token is used for both the REST API and starting the docker client if the Enforce Security Token option has been checked when creating the gateway. 如果在创建网关时选中了“强制安全令牌”选项,则该安全令牌将同时用于REST API和启动docker客户端。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM