evote icon indicating copy to clipboard operation
evote copied to clipboard

The "options.ca" property must be one of type string, Buffer, TypedArray, or DataView. Received type object

Open wchmiela opened this issue 4 years ago • 3 comments

After user registration, there is a response:

Failed to register user + E12345678 + : TypeError [ERR_INVALID_ARG_TYPE]: The "options.ca" property must be one of type string, Buffer, TypedArray, or DataView. Received type object response from registerVoter: { error: TypeError [ERR_INVALID_ARG_TYPE]: The "options.ca" property must be one of type string, Buffer, TypedArray, or DataView. Received type object at validateKeyOrCertOption (_tls_common.js:80:11) at Object.createSecureContext (_tls_common.js:110:9) at Object.connect (_tls_wrap.js:1403:48) at Agent.createConnection (https.js:125:22) at Agent.createSocket (_http_agent.js:234:26) at Agent.addRequest (_http_agent.js:193:10) at new ClientRequest (_http_client.js:276:16) at Object.request (https.js:309:10) at /Users/user/Desktop/evote/evote/web-app/server/node_modules/fabric-network/node_modules/fabric-ca-client/lib/FabricCAClient.js:306:37 at new Promise () }

Expected: I should register new user.

wchmiela avatar Jun 27 '20 08:06 wchmiela

Any news on that? I'm having the same issue when I'm deploying the application to IBM Cloud. When it's localhost it's working fine.

moraesslucas avatar Jun 30 '20 15:06 moraesslucas

Hey, @wchmiela I managed to fix the error.

In my ibpConnections.json under certificateAuthorities, it looked like this:

"certificateAuthorities": {
        "184.172.233.37:31814": {
            "url": "https://184.172.233.37:31814",
            "caName": "ca",
            "tlsCACerts": {
                "pem": [
                    "certificate in here"
                ]
            }
        }
    }

I just changed tlsCACerts.pem to a simple string instead of an array, so the fixed version was like this:

"certificateAuthorities": {
        "184.172.233.37:31814": {
            "url": "https://184.172.233.37:31814",
            "caName": "ca",
            "tlsCACerts": {
                "pem": "certificate in here"
            }
        }
    }

moraesslucas avatar Jun 30 '20 17:06 moraesslucas

@moraesslucas how can i find ibpConnection.js file in fabcar

umeraqeel786 avatar Jul 17 '20 18:07 umeraqeel786