Introducing the all-new TIBCO Community site!

For current users, please click "Sign In" to reset your password and access the enhanced features. If you're a first-time visitor, we extend a warm welcome—click "Sign Up" to become a part of the TIBCO Community!

If you're seeking alternative community sites, explore ibi, Jaspersoft, and Spotfire.

Jump to content

tibemsConnectionFactory_CreateConnection() returns TIBEMS_INVALID_PROTOCOL(15). Client on Windows OS, both server and client certificates added to the truststore - and also manupilated through C API. Tried tibemsConnection_CreateSSL returns the same.


Renfu Shiao
Go to solution Solved by Kurian Kuruvilla,

Recommended Posts

Sample code

TibcoConn()

{

tibems_status        status = TIBEMS_OK;

tibemsMsg          msg = NULL;

const char*         txt = NULL;

tibemsMsgType        msgType = TIBEMS_MESSAGE_UNKNOWN;

const char*         msgTypeName = "UNKNOWN";

tibemsConnectionFactory     factory = NULL;

tibemsConnection        connection = NULL;

tibemsSession          session = NULL;

tibemsMsgConsumer        msgConsumer = NULL;

tibemsDestination        destination = NULL;

//tibemsSSLParams         sslParams = NULL;

tibems_int           receive = 1;

rsSSLparams = tibemsSSLParams_Create();

rsPk_password = new char[20];

memset(rsPk_password, 0, 20);

memcpy(rsPk_password, "password", 9);

char** argv = NULL;

tibemsSSL_SetDebugTrace(TIBEMS_TRUE);

status = tibemsSSLParams_AddTrustedCertFile(rsSSLparams, "client.cert.pem",

TIBEMS_SSL_ENCODING_AUTO);

status = tibemsSSLParams_AddTrustedCertFile(rsSSLparams, "server.cert.pem",

TIBEMS_SSL_ENCODING_AUTO);

status = tibemsSSLParams_AddIssuerCertFile(rsSSLparams, "client_root.cert.pem",

TIBEMS_SSL_ENCODING_AUTO);

status = tibemsSSLParams_AddIssuerCertFile(rsSSLparams, "server_root.cert.pem",

TIBEMS_SSL_ENCODING_AUTO);

status = tibemsSSLParams_SetIdentityFile(rsSSLparams, "client_identity.p12",

TIBEMS_SSL_ENCODING_AUTO);

status = tibemsSSLParams_SetPrivateKeyFile(rsSSLparams, "client.key.pem",

TIBEMS_SSL_ENCODING_AUTO);

tibemsSSLParams_SetVerifyHost(rsSSLparams, TIBEMS_FALSE);

tibemsSSL_SetTrace(TIBEMS_TRUE);

const char* serverUrl = "ssh://devhost:7243";

status = tibemsConnectionFactory_SetServerURL(factory, serverUrl);

if (status != TIBEMS_OK)

{

//fail("Error setting server url", errorContext);

}

if (rsSSLparams)

{

status = tibemsConnectionFactory_SetSSLParams(factory, rsSSLparams);

if (status != TIBEMS_OK)

{

fail("Error setting ssl params", errorContext);

}

status = tibemsConnectionFactory_SetPkPassword(factory, rsPk_password);

if (status != TIBEMS_OK)

{

fail("Error setting pk password", errorContext);

}

}

//status = tibemsConnection_CreateSSL(&connection, serverUrl, "client", "user1", "pass1", rsSSLparams, rsPk_password);

status = tibemsConnectionFactory_CreateConnection(factory, &connection,

"user1", "pass1");

if (status != TIBEMS_OK)

{

fail("Error creating tibemsConnection", errorContext);

}

    ...

}

Link to comment
Share on other sites

×
×
  • Create New...