The remote certificate is invalid according to the validation procedure. (NCBC-554)

[NCBC-556] SslConnection uses obsolete GetBuffer method - throws NIE Created: 21/Jul/14  Updated: 22/Jul/14  Resolved: 21/Jul/14

Status: Resolved
Project: Couchbase .NET client library
Component/s: library
Affects Version/s: 2.0 DP2
Fix Version/s: 2.0 DP3

Type: Technical task Priority: Major
Reporter: Jeff Morris Assignee: Jeff Morris
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Refactoring artifact (the bad kind):

ERROR Couchbase.Authentication.SASL.SaslFactory - System.NotImplementedException: The method or operation is not implemented
   в Couchbase.IO.Operations.OperationBase`1.GetBuffer() в c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\IO\Operations\OperationBase'.cs:line 168
   в Couchbase.IO.Strategies.SslConnection.Send[T](IOperation`1 operation) в c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\IO\Strategies\SslConnection.cs:line 40
   в Couchbase.IO.Strategies.DefaultIOStrategy.Execute[T](IOperation`1 operation, IConnection connection) в c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\IO\Strategies\DefaultIOStrategy.cs:line 32
   в Couchbase.Authentication.SASL.SaslFactory.<GetFactory3>b__0(String username, String password, IOStrategy strategy, IByteConverter converter) в c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\Authentication\SASL\SaslFactory.cs:line 24

 Comments   
Comment by Jeff Morris [ 21/Jul/14 ]
commit 6ee63bd5c77bbc41e3680b902c744d29e6598114
Comment by Andrei Baranouski [ 22/Jul/14 ]
seems like it's not in repo yet?




[NCBC-555] Multi get can fail and return a null StatusCode Created: 18/Jul/14  Updated: 22/Jul/14

Status: Open
Project: Couchbase .NET client library
Component/s: library
Affects Version/s: 1.3.7
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Jim Walker Assignee: Jim Walker
Resolution: Unresolved Votes: 0
Labels: exception, null, rebalance
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: Server: 2.5.1 cluster - 3 nodes. 1 bucket
Client: Windows 7 (VM), VS Express 2013, CouchBase .NET SDK 1.3.7, .NET 3.5 or 4

Issue Links:
Dependency

 Description   
Found that performing a multi-get during a rebalance had a couple of issue when the code returns from the following line.

https://github.com/couchbase/couchbase-net-client/blob/4642a9d3ef32d5a00bcb458f108c8c002c4b1535/src/Enyim.Caching/Memcached/Protocol/Binary/MultiGetOperation.cs#L185

Client code is using client.ExecuteGet(<array of keys>)

The main issue is that the 'result.Fail' ends up back with the client and StatusCode == null, even though there's a "not my vbucket" status (7) in response.StatusCode.

Minor issue is that the result.Fail message doesn't get formatted to include the correlationId, always prints {0}.

I've a draft patch that ensures the StatusCode is passed through so that the client can see the failure is not-my-vbucket and issue a retry.

With my draft patch though I couldn't seem to get the StatusCode passed through without creating an "rv" and returning that.

Basically:

result.StatusCode = response.StatusCode;
return result.Fail(...);

and

this.StatusCode = response.StatusCode;
return result.Fail(...)

still returned StatusCode of null?



(patch attached soon)

 Comments   
Comment by Jim Walker [ 18/Jul/14 ]
Patch (researching appropriate test cases now....)

http://review.couchbase.org/#/c/39540/

With this patch and clients checking for not-my-vbucket all is well.
Comment by Jim Walker [ 21/Jul/14 ]
Previous patch abandoned. This one is a touch tidier

http://review.couchbase.org/#/c/39590

Regarding test-cases, this looks to be covered already but requires a careful rebalance timed with the correct test.

E.g. something like

When_Getting_Multiple_Existing_Keys_Result_Is_Successful()
Comment by Jim Walker [ 22/Jul/14 ]
Correct branch this time!

http://review.couchbase.org/39658




[NCBC-554] The remote certificate is invalid according to the validation procedure. Created: 18/Jul/14  Updated: 21/Jul/14  Resolved: 21/Jul/14

Status: Resolved
Project: Couchbase .NET client library
Component/s: library
Affects Version/s: 2.0 DP2
Fix Version/s: 2.0 DP3

Type: Bug Priority: Blocker
Reporter: Andrei Baranouski Assignee: Jeff Morris
Resolution: Duplicate Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: PNG File cert_screen.png    
Sub-Tasks:
Key
Summary
Type
Status
Assignee
NCBC-556 SslConnection uses obsolete GetBuffer... Technical task Resolved Jeff Morris  

 Description   
as a continuation of the NCBC-553 ticket

in my tests i set use ssl for ClientConfiguration & BucketConfiguration

var bucketConfiguration = new BucketConfiguration();
bucketConfiguration.UseSsl = true;
var config = new ClientConfiguration();
config.UseSsl=true;

Then I've install cluster's certificate on vm where I run my tests(see sceenshot)

when I run my tests I get

client logs:

2014-07-16 16:19:16,768 [4] DEBUG Couchbase.Core.ClusterManager - !!Trying to boostrap with Couchbase.Configuration.Server.Providers.CarrierPublication.CarrierPublicationProvider.
2014-07-16 16:19:16,950 [4] WARN Couchbase.IO.ConnectionBase - Starting SSL encryption on 10.3.121.134
2014-07-16 16:19:17,041 [4] WARN Couchbase.Core.ClusterManager - System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
   at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception)
   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
   at System.Net.Security.SslStream.AuthenticateAsClient(String targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation)
   at System.Net.Security.SslStream.AuthenticateAsClient(String targetHost)
   at Couchbase.IO.Strategies.SslConnection.Authenticate() in c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\IO\Strategies\SslConnection.cs:line 34
   at Couchbase.IO.DefaultConnectionFactory.<GetGeneric>b__4[T](IConnectionPool`1 p, IByteConverter c) in c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\IO\DefaultConnectionFactory.cs:line 69
   at Couchbase.IO.ConnectionPool`1.Acquire() in c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\IO\ConnectionPool.cs:line 108
   at Couchbase.IO.ConnectionPool`1.Couchbase.IO.IConnectionPool.Acquire() in c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\IO\ConnectionPool.cs:line 170
   at Couchbase.Authentication.SASL.SaslFactory.<GetFactory3>b__0(String username, String password, IOStrategy strategy, IByteConverter converter) in c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\Authentication\SASL\SaslFactory.cs:line 21
   at Couchbase.Configuration.Server.Providers.CarrierPublication.CarrierPublicationProvider.GetConfig(String bucketName, String password) in c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\Configuration\Server\Providers\CarrierPublication\CarrierPublicationProvider.cs:line 31
   at Couchbase.Core.ClusterManager.CreateBucket(String bucketName, String password) in c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\Core\ClusterManager.cs:line 149


test logs:

 c:\jenkins\workspace\.net-sdkdclient-ng2-andrei\sdkdclient-ng>call packages\sdkdclient\bin\brun.bat -I cluster_config.ini -I sdkd.args --variants HYBRID -d all:debug --no-upload
[0.34 INFO] (BRun run:435) Initializing history database
Will create SASL????true
Will create SASL????true
Will create SASL????true
Will create SASL????true

============================================================
Running Rb2Out-HYBRID
    rebalance/mode=out
    workload=HybridWorkloadGroup
    rebalance/count=2
    testcase=RebalanceScenario
    Logging to c:\jenkins\workspace\.net-sdkdclient-ng2-andrei\sdkdclient-ng\log\SDK-SDK\CB-3.0.0-933\Rb2Out-HYBRID\07-16-14\083910\444e6acd28e9170d8ce86bfc626d8674

    To re-run the test, copy/paste the following into the shell.
    You may also copy/paste (except the first line) into an argfile
    8<----------------------------------------
    ./stester \
 \ --rebalance-mode out --workload HybridWorkloadGroup
 \ --rebalance-count 2 --testcase RebalanceScenario -C share\rexec
 \ --rexec_path C:\temp\sdkd-out-debug\SdkdConsole.exe --rexec_port
 \ 8675 --cluster_node=10.3.121.134 --cluster_node=10.3.121.135
 \ --cluster_node=10.3.121.136 --cluster_node=10.3.3.206
 \ --cluster_ssh-username=root --cluster_ssh-password=couchbase
        --cluster_useSSL=True
    ---------------------------------------->8
[1.58 WARN] (Drivers getDriver:76) 'rexec' is now mapped to *local* execution only. Use RemoteExecutingDriver for remote execution
Will create SASL????true
Will create SASL????true
Will create SASL????true
Will create SASL????true
[2.05 INFO] (RunContext run:102) Ramp for 30 seconds. Cluster modification: remove 2 nodes and rebalance. Rebound for 90 seconds.
[2.07 INFO] (RunContext run:124) Starting cluster and driver
[2.08 INFO] (CBCluster startCluster:360) Node http://10.3.121.134:8091 is master now
[2.08 INFO] (HostPortDriver launch:32) Invoking SDKD as 'C:\temp\sdkd-out-debug\SdkdConsole.exe'
[2.08 DEBUG] (CBCluster startCluster:366) Stopping any existing rebalance operations..
[2.44 INFO] (SDKD log:137) --- Logging Self-Test ---
[2.46 INFO] (SDKD log:137) [Sdkd.Main|Info] Info Message
[2.46 INFO] (SDKD log:137) [Sdkd.Main|Warn] Warn Message
[2.47 INFO] (SDKD log:137) [Sdkd.Main|Error] Error Message
[2.47 INFO] (SDKD log:137) [Sdkd.Main|Fatal] Fatal Message
[2.47 INFO] (SDKD log:137) [Sdkd.Main|Info] SDKD Listening on port 8675
[2.62 DEBUG] (Handle sendMessageAsync:183) > INFO@0.0
[2.63 INFO] (SDKD log:137) [Sdkd.Control|Info] Got a new connection. Creating child handle
[2.92 DEBUG] (Handle receiveMessage:158) < INFO@0.0 => {"CAPS":{"DS_SHARED":true,"PREAMBLE":false,"CANCEL":true,"CONTINUOUS":true},"COMPONENTS":{"SDK":"1.0.0.0","CLR":"4.0.30319.17929"}}
[3.33 DEBUG] (CBCluster clearSingleCluster:140) Failing over existing node <URI:10.3.121.135:8091,ns_1@10.3.121.135>
[3.36 DEBUG] (CBCluster clearSingleCluster:140) Failing over existing node <URI:10.3.121.136:8091,ns_1@10.3.121.136>
[3.39 DEBUG] (CBCluster clearSingleCluster:140) Failing over existing node <URI:10.3.3.206:8091,ns_1@10.3.3.206>
[3.49 DEBUG] (SSHConnection initUserKeys:79) Loaded indentity C:\Users\Administrator\.ssh\id_rsa
[3.50 DEBUG] (SSHConnection connect:99) Connecting with User[root] Pass[HASH=3b8cf05627127baaf3808913209aac84]
[3.50 DEBUG] (SSHConnection initUserKeys:79) Loaded indentity C:\Users\Administrator\.ssh\id_rsa
[3.51 DEBUG] (SSHConnection connect:99) Connecting with User[root] Pass[HASH=3b8cf05627127baaf3808913209aac84]
[4.06 INFO] (NodeHost createSSH:147) SSH Initialized for http://10.3.121.134:8091
[4.07 INFO] (NodeHost createSSH:147) SSH Initialized for http://10.3.121.135:8091
[4.07 INFO] (NodeHost createSSH:147) SSH Initialized for http://10.3.121.136:8091
[4.07 INFO] (NodeHost createSSH:147) SSH Initialized for http://10.3.3.206:8091
[4.09 DEBUG] (SSHCommand execute:75) Running /etc/init.d/couchbase-server start && pkill -CONT -f memcached && pkill -CONT -f beam.smp && iptables -F && iptables -t nat -F on 10.3.121.136
[4.09 DEBUG] (SSHCommand execute:75) Running /etc/init.d/couchbase-server start && pkill -CONT -f memcached && pkill -CONT -f beam.smp && iptables -F && iptables -t nat -F on 10.3.121.134
[4.10 DEBUG] (SSHCommand execute:75) Running /etc/init.d/couchbase-server start && pkill -CONT -f memcached && pkill -CONT -f beam.smp && iptables -F && iptables -t nat -F on 10.3.121.135
[4.10 DEBUG] (SSHCommand execute:75) Running /etc/init.d/couchbase-server start && pkill -CONT -f memcached && pkill -CONT -f beam.smp && iptables -F && iptables -t nat -F on 10.3.3.206
[4.30 DEBUG] (SSHCommand close:147) Closing channel com.jcraft.jsch.ChannelExec@174323d5
[4.31 DEBUG] (SSHCommand close:147) Closing channel com.jcraft.jsch.ChannelExec@f5d8d75
[4.31 DEBUG] (SSHCommand close:147) Closing channel com.jcraft.jsch.ChannelExec@3af2164f
[4.32 DEBUG] (SSHCommand close:147) Closing channel com.jcraft.jsch.ChannelExec@74bfd10a
[4.32 DEBUG] (CBCluster setupNewCluster:271) Provisioning initial node com.couchbase.cbadmin.client.CouchbaseAdmin@5d684e26
[25.89 DEBUG] (CBCluster tryOnce:286) Adding node http://10.3.121.135:8091
[31.16 DEBUG] (CBCluster tryOnce:286) Adding node http://10.3.121.136:8091
[34.06 DEBUG] (CBCluster tryOnce:286) Adding node http://10.3.3.206:8091
[39.84 INFO] (CBCluster setupNewCluster:293) All nodes added. Will rebalance
[39.87 DEBUG] (RebalanceWaiter sweepOnce:38) Rebalance Progress: 0%
[40.88 INFO] (RebalanceWaiter sweepOnce:33) Rebalance complete
[40.88 DEBUG] (CBCluster setupServerGroups:222) Not creating any groups
[40.89 INFO] (CBCluster setupMainBucket:209) Creating bucket default
[40.90 INFO] (CBCluster setupMainBucket:211) Bucket creation submitted
[47.18 INFO] (CBCluster waitForBucketReady:203) Bucket creation done
[47.22 INFO] (RunContext run:143) Driver and cluster initialized
[47.24 INFO] (RunContext call:167) Running scenario..
[47.24 INFO] (Scenario run:72) Starting RAMP phase
[47.24 INFO] (Workload setupDesign:63) Creating design test_design
[47.50 INFO] (Workload setupDesign:80) Design creation done
[47.50 DEBUG] (Handle sendMessageAsync:183) > NEWHANDLE@101.1 => {Port=8091, Bucket=default, Options={SSL=true, Username=default, Password=, OtherNodes=[["10.3.121.135",8091],["10.3.121.136",8091],["
0.3.3.206",8091]]}, Hostname=10.3.121.134}
[47.51 INFO] (SDKD log:137) [Sdkd.Control|Info] Got a new connection. Creating child handle
[47.51 INFO] (SDKD log:137) [Sdkd.Control|Info] Registering handle 101
[47.52 INFO] (SDKD log:137) ClientConfiguration!!!!!!!!!!!!{
[47.52 INFO] (SDKD log:137) "Port": 8091,
[47.52 INFO] (SDKD log:137) "Bucket": "default",
[47.53 INFO] (SDKD log:137) "Options": {
[47.53 INFO] (SDKD log:137) "SSL": true,
[47.53 INFO] (SDKD log:137) "Username": "default",
[47.53 INFO] (SDKD log:137) "Password": "",
[47.54 INFO] (SDKD log:137) "OtherNodes": [
[47.54 INFO] (SDKD log:137) [
[47.54 INFO] (SDKD log:137) "10.3.121.135",
[47.55 INFO] (SDKD log:137) 8091
[47.55 INFO] (SDKD log:137) ],
[47.55 INFO] (SDKD log:137) [
[47.55 INFO] (SDKD log:137) "10.3.121.136",
[47.56 INFO] (SDKD log:137) 8091
[47.56 INFO] (SDKD log:137) ],
[47.56 INFO] (SDKD log:137) [
[47.56 INFO] (SDKD log:137) "10.3.3.206",
[47.57 INFO] (SDKD log:137) 8091
[47.57 INFO] (SDKD log:137) ]
[47.57 INFO] (SDKD log:137) ]
[47.57 INFO] (SDKD log:137) },
[47.58 INFO] (SDKD log:137) "Hostname": "10.3.121.134"
[47.58 INFO] (SDKD log:137) }
[47.58 INFO] (SDKD log:137) [Sdkd.ClientFactory|Info] Creating new shared client for key 'U,P,H10.3.121.134:8091,Bdefault'
[48.13 INFO] (SDKD log:137)
[48.14 INFO] (SDKD log:137) Unhandled Exception: Couchbase.Configuration.ConfigException: Could not bootstrap default. See log for details.
[52.62 INFO] (SDKD log:137) +++ Flushing remaining exception trace buffer
[52.62 DEBUG] (Handle sendMessageAsync:183) > CLOSEHANDLE@101.2
[52.62 INFO] (SDKD log:137) at Couchbase.Core.ClusterManager.CreateBucket(String bucketName, String password) in c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\Core\ClusterMana
er.cs:line 204
   at Couchbase.Core.ClusterManager.CreateBucket(String bucketName) in c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\Core\ClusterManager.cs:line 137
   at Couchbase.CouchbaseCluster.OpenBucket() in c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\CouchbaseCluster.cs:line 70
   at Sdkd.Couchbase.ClientFactory.FindExistingClient(ClientConfiguration config) in c:\jenkins\workspace-net2\sdkd-net\src\Sdkd\Couchbase\ClientFactory.cs:line 77
   at Sdkd.Couchbase.ClientFactory.CreateClient(ClientConfiguration config) in c:\jenkins\workspace-net2\sdkd-net\src\Sdkd\Couchbase\ClientFactory.cs:line 256
   at SdkdConsole.Daemon.Handle.CreateHandle(Request req) in c:\jenkins\workspace-net2\sdkd-net\src\SdkdConsole\Daemon\Handle.cs:line 84
   at SdkdConsole.Daemon.Handle.Run() in c:\jenkins\workspace-net2\sdkd-net\src\SdkdConsole\Daemon\Handle.cs:line 103
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
[52.64 WARN] (STester close:170) While stopping driver
java.net.SocketException: Connection reset by peer: socket write error
        at java.net.SocketOutputStream.socketWrite0(Native Method) ~[na:1.6.0_27]
        at java.net.SocketOutputStream.socketWrite(Unknown Source) ~[na:1.6.0_27]
        at java.net.SocketOutputStream.write(Unknown Source) ~[na:1.6.0_27]
        at sun.nio.cs.StreamEncoder.writeBytes(Unknown Source) ~[na:1.6.0_27]
        at sun.nio.cs.StreamEncoder.implFlushBuffer(Unknown Source) ~[na:1.6.0_27]
        at sun.nio.cs.StreamEncoder.implFlush(Unknown Source) ~[na:1.6.0_27]
        at sun.nio.cs.StreamEncoder.flush(Unknown Source) ~[na:1.6.0_27]
        at java.io.OutputStreamWriter.flush(Unknown Source) ~[na:1.6.0_27]
        at java.io.BufferedWriter.flush(Unknown Source) ~[na:1.6.0_27]
        at com.couchbase.sdkdclient.handle.Handle.sendMessageAsync(Handle.java:188) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.handle.Handle.close(Handle.java:254) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.driver.HandleManager.stopAll(HandleManager.java:26) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.driver.HostPortDriver.stop(HostPortDriver.java:118) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.driver.ExecutingDriver.stop(ExecutingDriver.java:117) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.stester.STester.close(STester.java:167) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.batch.BRun.runHarness(BRun.java:281) [sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.batch.BRun.runSingleTest(BRun.java:388) [sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.batch.BRun.run(BRun.java:472) [sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.batch.BRun.main(BRun.java:504) [sdkdclient-1.0-SNAPSHOT.jar:na]
[52.80 ERROR] (BRun main:507) Caught exception
com.couchbase.sdkdclient.context.HarnessException: java.net.SocketException: Connection reset
        at com.couchbase.sdkdclient.context.HarnessException.create(HarnessException.java:56) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.scenario.PhasedScenario.run(PhasedScenario.java:80) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.context.RunContext$4.call(RunContext.java:169) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.context.RunContext$4.call(RunContext.java:165) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) ~[na:1.6.0_27]
        at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.6.0_27]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[na:1.6.0_27]
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) ~[na:1.6.0_27]
        at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.6.0_27]
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) ~[na:1.6.0_27]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[na:1.6.0_27]
        at java.lang.Thread.run(Unknown Source) ~[na:1.6.0_27]
Caused by: java.net.SocketException: Connection reset
        at java.net.SocketInputStream.read(Unknown Source) ~[na:1.6.0_27]
        at sun.nio.cs.StreamDecoder.readBytes(Unknown Source) ~[na:1.6.0_27]
        at sun.nio.cs.StreamDecoder.implRead(Unknown Source) ~[na:1.6.0_27]
        at sun.nio.cs.StreamDecoder.read(Unknown Source) ~[na:1.6.0_27]
        at java.io.InputStreamReader.read(Unknown Source) ~[na:1.6.0_27]
        at java.io.BufferedReader.fill(Unknown Source) ~[na:1.6.0_27]
        at java.io.BufferedReader.readLine(Unknown Source) ~[na:1.6.0_27]
        at java.io.BufferedReader.readLine(Unknown Source) ~[na:1.6.0_27]
        at com.couchbase.sdkdclient.handle.Handle.receiveMessage(Handle.java:152) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.handle.Handle.sendMessage(Handle.java:173) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.handle.Handle.negotiate(Handle.java:237) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.handle.HandleFactory.createHandle(HandleFactory.java:43) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.workload.ViewWorkload.loadData(ViewWorkload.java:85) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.workload.HybridWorkloadGroup.start(HybridWorkloadGroup.java:82) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.scenario.PhasedScenario.run(PhasedScenario.java:78) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        ... 10 common frames omitted


Jeff, I think I have correctly installed the certificate, but why do I get this error


 Comments   
Comment by Andrei Baranouski [ 21/Jul/14 ]
another attempt:

before creating the connection programmatically install a certificate:
            string file = "C:\\temp\\certificate"; // Contains name of certificate file
            X509Store store = new X509Store(StoreName.Root, StoreLocation.CurrentUser);
            store.Open(OpenFlags.ReadWrite);
            store.Add(new X509Certificate2(X509Certificate2.CreateFromCertFile(file)));
            store.Close();




client logs:

2014-07-21 12:19:53,172 [4] DEBUG Couchbase.Core.ClusterManager - !!Trying to boostrap with Couchbase.Configuration.Server.Providers.CarrierPublication.CarrierPublicationProvider.
2014-07-21 12:19:53,432 [4] WARN Couchbase.IO.ConnectionBase - Starting SSL encryption on 10.3.121.134
2014-07-21 12:19:53,981 [4] DEBUG Couchbase.IO.ConnectionPool`1 - Acquire new: f513fedf-af29-43c7-aafe-bd7811a46038 - [0, 0]
2014-07-21 12:19:53,996 [4] ERROR Couchbase.Authentication.SASL.SaslFactory - System.NotImplementedException: The method or operation is not implemented
   в Couchbase.IO.Operations.OperationBase`1.GetBuffer() в c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\IO\Operations\OperationBase'.cs:line 168
   в Couchbase.IO.Strategies.SslConnection.Send[T](IOperation`1 operation) в c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\IO\Strategies\SslConnection.cs:line 40
   в Couchbase.IO.Strategies.DefaultIOStrategy.Execute[T](IOperation`1 operation, IConnection connection) в c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\IO\Strategies\DefaultIOStrategy.cs:line 32
   в Couchbase.Authentication.SASL.SaslFactory.<GetFactory3>b__0(String username, String password, IOStrategy strategy, IByteConverter converter) в c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\Authentication\SASL\SaslFactory.cs:line 24
2014-07-21 12:19:54,243 [4] WARN Couchbase.IO.ConnectionBase - Starting SSL encryption on 10.3.121.134
2014-07-21 12:19:54,737 [4] DEBUG Couchbase.IO.ConnectionPool`1 - Acquire new: 3cc96df3-2534-4c79-a5c3-12e2a635b156 - [0, 1]


test logs:

[46,24 DEBUG] (CBCluster setupServerGroups:222) Not creating any groups
[46,49 INFO] (CBCluster setupMainBucket:209) Creating bucket default
[46,75 INFO] (CBCluster setupMainBucket:211) Bucket creation submitted
[52,35 INFO] (CBCluster waitForBucketReady:203) Bucket creation done
[55,24 INFO] (RunContext run:143) Driver and cluster initialized
[55,51 INFO] (RunContext call:167) Running scenario..
[55,51 INFO] (Scenario run:72) Starting RAMP phase
[55,51 INFO] (Workload setupDesign:63) Creating design test_design
[56,81 INFO] (Workload setupDesign:80) Design creation done
[56,81 INFO] (SDKD log:137) [Sdkd.Control|Info] Got a new connection. Creating child handle
[56,81 DEBUG] (Handle sendMessageAsync:183) > NEWHANDLE@101.1 => {Port=8091, Bucket=default, Options={SSL=true, Username=default, Password=, OtherNodes=[["10.3.121.135",8091],["10.3.121.136",8091],["10.3.3.206",8091]]}, Hostname=10.3.121.134}
[56,82 INFO] (SDKD log:137) [Sdkd.Control|Info] Registering handle 101
[62,01 INFO] (SDKD log:137) [Sdkd.ClientFactory|Info] Creating new shared client for key 'U,P,H10.3.121.134:8091,Bdefault'
[62,01 INFO] (SDKD log:137) [Sdkd.Main|Info] Resolving Common.Logging.Log4Net
[62,01 INFO] (SDKD log:137) [Sdkd.Main|Info] Have assembly Common.Logging.Log4Net, Version=2.0.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e
[62,01 INFO] (SDKD log:137) [Sdkd.Main|Info] Resolving log4net
[62,02 INFO] (SDKD log:137) [Sdkd.Main|Info] Have assembly log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821
[63,69 INFO] (SDKD log:137)
[63,70 INFO] (SDKD log:137) Unhandled exception: System.NotImplementedException: The method or operation is not implemented
[63,71 INFO] (SDKD log:137) в Couchbase.IO.Operations.OperationBase`1.GetBuffer() в c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\IO\Operations\OperationBase'.cs:line 168
[63,71 INFO] (SDKD log:137) в Couchbase.IO.Strategies.SslConnection.Send[T](IOperation`1 operation) в c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\IO\Strategies\SslConnection.cs:line 40
[63,71 INFO] (SDKD log:137) в Couchbase.IO.Strategies.DefaultIOStrategy.Execute[T](IOperation`1 operation, IConnection connection) в c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\IO\Strategies\DefaultIOStrategy.cs:line 32
[63,71 INFO] (SDKD log:137) в Couchbase.IO.Strategies.DefaultIOStrategy.Execute[T](IOperation`1 operation) в c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\IO\Strategies\DefaultIOStrategy.cs:line 42
[63,72 INFO] (SDKD log:137) в Couchbase.Configuration.Server.Providers.CarrierPublication.CarrierPublicationProvider.GetConfig(String bucketName, String password) в c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\Configuration\S
erver\Providers\CarrierPublication\CarrierPublicationProvider.cs:line 35
[63,72 INFO] (SDKD log:137) в Couchbase.Core.ClusterManager.CreateBucket(String bucketName, String password) в c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\Core\ClusterManager.cs:line 149
[63,72 INFO] (SDKD log:137) в Couchbase.Core.ClusterManager.CreateBucket(String bucketName) в c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\Core\ClusterManager.cs:line 137
[63,73 INFO] (SDKD log:137) в Couchbase.CouchbaseCluster.OpenBucket() в c:\jenkins\workspace-net2\couchbase-csharp-client-ng\Src\Couchbase\CouchbaseCluster.cs:line 70
[63,73 INFO] (SDKD log:137) в Sdkd.Couchbase.ClientFactory.FindExistingClient(ClientConfiguration config) в c:\jenkins\workspace-net2\sdkd-net\src\Sdkd\Couchbase\ClientFactory.cs:line 78
[63,73 INFO] (SDKD log:137) в Sdkd.Couchbase.ClientFactory.CreateClient(ClientConfiguration config) в c:\jenkins\workspace-net2\sdkd-net\src\Sdkd\Couchbase\ClientFactory.cs:line 264
[63,74 INFO] (SDKD log:137) в SdkdConsole.Daemon.Handle.CreateHandle(Request req) в c:\jenkins\workspace-net2\sdkd-net\src\SdkdConsole\Daemon\Handle.cs:line 84
[63,74 INFO] (SDKD log:137) в SdkdConsole.Daemon.Handle.Run() в c:\jenkins\workspace-net2\sdkd-net\src\SdkdConsole\Daemon\Handle.cs:line 103
[63,74 INFO] (SDKD log:137) в System.Threading.ThreadHelper.ThreadStart_Context(Object state)
[63,75 INFO] (SDKD log:137) в System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
[63,75 INFO] (SDKD log:137) в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
[63,75 INFO] (SDKD log:137) в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
[63,76 INFO] (SDKD log:137) в System.Threading.ThreadHelper.ThreadStart()
[71,69 DEBUG] (Handle sendMessageAsync:183) > CLOSEHANDLE@101.2
[71,71 WARN] (STester close:170) While stopping driver
java.net.SocketException: Connection reset by peer: socket write error
        at java.net.SocketOutputStream.socketWrite0(Native Method) ~[na:1.7.0_60]
        at java.net.SocketOutputStream.socketWrite(Unknown Source) ~[na:1.7.0_60]
        at java.net.SocketOutputStream.write(Unknown Source) ~[na:1.7.0_60]
        at sun.nio.cs.StreamEncoder.writeBytes(Unknown Source) ~[na:1.7.0_60]
        at sun.nio.cs.StreamEncoder.implFlushBuffer(Unknown Source) ~[na:1.7.0_60]
        at sun.nio.cs.StreamEncoder.implFlush(Unknown Source) ~[na:1.7.0_60]
        at sun.nio.cs.StreamEncoder.flush(Unknown Source) ~[na:1.7.0_60]
        at java.io.OutputStreamWriter.flush(Unknown Source) ~[na:1.7.0_60]
        at java.io.BufferedWriter.flush(Unknown Source) ~[na:1.7.0_60]
        at com.couchbase.sdkdclient.handle.Handle.sendMessageAsync(Handle.java:188) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.handle.Handle.close(Handle.java:254) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.driver.HandleManager.stopAll(HandleManager.java:26) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.driver.HostPortDriver.stop(HostPortDriver.java:118) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.driver.ExecutingDriver.stop(ExecutingDriver.java:117) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.stester.STester.close(STester.java:167) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.batch.BRun.runHarness(BRun.java:281) [sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.batch.BRun.runSingleTest(BRun.java:388) [sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.batch.BRun.run(BRun.java:472) [sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.batch.BRun.main(BRun.java:504) [sdkdclient-1.0-SNAPSHOT.jar:na]
[71,97 ERROR] (BRun main:507) Caught exception
com.couchbase.sdkdclient.context.HarnessException: java.net.SocketException: Connection reset
        at com.couchbase.sdkdclient.context.HarnessException.create(HarnessException.java:56) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.scenario.PhasedScenario.run(PhasedScenario.java:80) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.context.RunContext$4.call(RunContext.java:169) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.context.RunContext$4.call(RunContext.java:165) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.7.0_60]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[na:1.7.0_60]
        at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.7.0_60]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[na:1.7.0_60]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[na:1.7.0_60]
        at java.lang.Thread.run(Unknown Source) ~[na:1.7.0_60]
Caused by: java.net.SocketException: Connection reset
        at java.net.SocketInputStream.read(Unknown Source) ~[na:1.7.0_60]
        at java.net.SocketInputStream.read(Unknown Source) ~[na:1.7.0_60]
        at sun.nio.cs.StreamDecoder.readBytes(Unknown Source) ~[na:1.7.0_60]
        at sun.nio.cs.StreamDecoder.implRead(Unknown Source) ~[na:1.7.0_60]
        at sun.nio.cs.StreamDecoder.read(Unknown Source) ~[na:1.7.0_60]
        at java.io.InputStreamReader.read(Unknown Source) ~[na:1.7.0_60]
        at java.io.BufferedReader.fill(Unknown Source) ~[na:1.7.0_60]
        at java.io.BufferedReader.readLine(Unknown Source) ~[na:1.7.0_60]
        at java.io.BufferedReader.readLine(Unknown Source) ~[na:1.7.0_60]
        at com.couchbase.sdkdclient.handle.Handle.receiveMessage(Handle.java:152) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.handle.Handle.sendMessage(Handle.java:173) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.handle.Handle.negotiate(Handle.java:237) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.handle.HandleFactory.createHandle(HandleFactory.java:43) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.workload.ViewWorkload.loadData(ViewWorkload.java:85) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.workload.HybridWorkloadGroup.start(HybridWorkloadGroup.java:82) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        at com.couchbase.sdkdclient.scenario.PhasedScenario.run(PhasedScenario.java:78) ~[sdkdclient-1.0-SNAPSHOT.jar:na]
        ... 8 common frames omitted

Comment by Jeff Morris [ 21/Jul/14 ]
https://www.couchbase.com/issues/browse/NCBC-556




Generated at Tue Jul 22 11:09:38 CDT 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.