nlight-jdev / jcouchdb

Automatically exported from code.google.com/p/jcouchdb
Other
0 stars 0 forks source link

how to ensure the connection is safe #70

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Database db=new Database(dbHost,dbPort,dbName);
Server server=db.getServer();

so anyone can use the two lines codes to operate our database if he know our 
database's ip and port.
As we all know that,"connection = DriverManager.getConnection(
url, username, password )" used in mysql connection.   
so i want to know how to ensure the connection is safe with username and 
password of the database?

Original issue reported on code.google.com by bupt.z...@gmail.com on 24 Dec 2010 at 2:25

GoogleCodeExporter commented 8 years ago
help?  Could give me some clues? God! Safe!How?

Original comment by bupt.z...@gmail.com on 25 Dec 2010 at 1:56

GoogleCodeExporter commented 8 years ago
This is mostly a CouchDB and not a jcouchdb issue. You can setup CouchDB with 
users and passwords which you should be able to set via 
org.jcouchdb.db.ServerImpl.setCredentials(AuthScope, Credentials). There's also 
a constructor that enables ServerImpl to use https connections.

You can also just set up firewall rules so your CouchDB instance can only be 
accessed from certain (maybe local) IPs. 

Original comment by ff...@gmx.de on 25 Dec 2010 at 1:52

GoogleCodeExporter commented 8 years ago
As noted above, the database (not the client) controls whether authentication 
is required.  Since jcouchdb uses the Apache HTTP client library, client 
authentication is provided.  If there are additional features of the HTTP 
client library that need to be made available from ServerImpl.java, please 
reopen this issue.

Original comment by smoye...@gmail.com on 23 Apr 2012 at 12:35