简体   繁体   English

如何在Java应用程序和数据库之间建立安全连接?

[英]How to establish secure connection between java application and database?

In an interview, Interview asked me an question : 在一次采访中,采访问我一个问题:

  • The communication between our application and the remote database must be done with https (more secure). 我们的应用程序与远程数据库之间的通信必须使用https(更安全)来完成。

How could you do it? 你怎么能做到 I didn't find any clue for this question in google also. 我也没有在谷歌找到这个问题的任何线索。

How to establish secure connection between java application and database? 如何在Java应用程序和数据库之间建立安全连接? Please help me. 请帮我。

HTTPS? HTTPS? If your client is using something proprietary with a web server acting as an intermediary to talk to the db server it would (one would hope) be transparent between your application the & web server; 如果您的客户端使用专有的Web服务器作为中介来与db服务器通信,则(希望)您的应用程序与&Web服务器之间是透明的; simply change from HTTP to HTTPS, ditto if you're using SQL Server web service end-points (which you can make use HTTPS). 只需将HTTP更改为HTTPS,如果使用的是SQL Server Web服务端点(也可以使用HTTPS),则也可以更改为HTTPS。

If perhaps you mean SSL then SQL server supports encrypted connections between client and server, see this question. 如果您的意思是SSL,那么SQL Server支持客户端和服务器之间的加密连接,请参阅问题。

Google for JDBC connection over SSL. Google通过SSL用于JDBC连接。 See here for an example. 请参阅此处的示例。

Hopefully the person who asked the question wasn't seriously thinking about exposing a database to the wider Internet. 希望提出这个问题的人没有认真考虑将数据库公开给更广泛的Internet。 If they were, better not to accept that position. 如果是这样,最好不要接受这个立场。

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

相关问题 如何在Java 7和OpenShift应用程序之间建立HTTPS连接? - How to establish a HTTPS connection between Java 7 and an OpenShift application? 如何建立与数据库的连接 - How to establish connection with database 使用Java在App Server和Oracle数据库之间建立连接 - Establish connection between app server and oracle database using java 如何在不使用IDE /外部工具的情况下在Java程序和数据库之间建立连接? - How to establish connection between Java Program and Database without using IDE/ External Tools? 如何在Play 2服务器和C#应用程序之间建立套接字连接? - How to establish a socket connection between a Play 2 server and a C# application? 如何使用 JDBC Java 与 .xml 文件建立数据库连接 - how to establish a database connection with an .xml file using JDBC Java 安全的Java应用程序数据库 - Secure Java Application Database Web 应用程序无法建立与数据库的连接 - Web application cannot establish connection to database 使用 Java 建立到 MySQL Amazon RDS (SSL/TLS) 的安全连接 - Using Java to establish a secure connection to MySQL Amazon RDS (SSL/TLS) 无法建立与安全mysql开放套接字的Java SSLSocket连接 - Failing to establish an Java SSLSocket connection to a secure mysql open socket
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM