Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
-
None
-
python sdk 3.0.4
-
1
Description
1. Setup cluster with x509 and with client auth. Create a bucke -test, scope - scope1, collection - collection1
2. Now connect via python SDK using client auth and do an insert
3. There are no errors via insert, but document does not get inserted.
– Same code works with plain authentication.
from couchbase.cluster import Cluster
|
from couchbase_core.cluster import PasswordAuthenticator
|
from couchbase.durability import Durability
|
from couchbase.cluster import ClusterOptions
|
from couchbase_core.cluster import CertAuthenticator
|
from couchbase_core.connstr import ConnectionString
|
|
try:
|
connstr=ConnectionString.parse("couchbases://10.112.190.102")
|
connstr.set_option('certpath','/tmp/newcerts76/172.16.1.174.pem')
|
connstr.set_option('keypath','/tmp/newcerts76/172.16.1.174.key')
|
connstr.set_option('truststorepath','/tmp/newcerts76/long_chain172.16.1.174.pem')
|
cluster = Cluster(str(connstr),ClusterOptions(PasswordAuthenticator("username","password")))
|
authenticator = PasswordAuthenticator('Administrator', 'password')
|
cluster = Cluster('couchbase://10.112.190.102',ClusterOptions(authenticator))
|
cb = cluster.bucket('test')
|
scope = cb.scope("scope1")
|
cb_coll = scope.collection("collection1")
|
cb_coll.insert('king_arthur', {'name': 'Arthur', 'email': 'kingarthur@couchbase.com', 'interests': ['Holy Grail', 'African Swallows']})
|
print (cb_coll.get('king_arthur').value)
|
except Exception as e:
|
print (e)
|
|
'''
|
cluster = Cluster("couchbases://10.112.190.102",ClusterOptions(PasswordAuthenticator(cluster_username="admin_user",cluster_password="admin_password", cert_path="/tmp/newcerts76/172.16.1.174.pem", key_path="/tmp/newcerts76/172.16.1.174.key", trust_store_path="/tmp/newcerts76/long_chain172.16.1.174.pem")))
|
'''
|
#authenticator = PasswordAuthenticator('Administrator', 'password')
|
#cluster = Cluster('couchbase://10.112.190.102',ClusterOptions(authenticator))
|