JMS Secure integration using .Net C#, How to do :-
I am using this code, but it throwing error –
string ssl_identity = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "certificate", "cacerts.p12");
string ssl_target_hostname = serverUrl;
string ssl_password = KeyConstants.config_cert_hash;
EMSSSLFileStoreInfo StoreInfo = new EMSSSLFileStoreInfo();
StoreInfo.SetSSLClientIdentity(ssl_identity);
StoreInfo.SetSSLPassword(ssl_password.ToCharArray());
hashEnvironment.Add(EMSSSL.TRACE, true);
hashEnvironment.Add(EMSSSL.CLIENT_TRACER, true);
//StoreInfo.SetSSLTrustedCertificate(ssl_identity);
//hashEnvironment.Add(LookupContext.SSL_HOST_NAME_VERIFIER, false);
hashEnvironment.Add(LookupContext.PROVIDER_URL, serverUrl);
if (userName != null)
{
hashEnvironment.Add(LookupContext.SECURITY_PRINCIPAL, userName);
if (password != null)
hashEnvironment.Add(LookupContext.SECURITY_CREDENTIALS, password);
}
hashEnvironment.Add(LookupContext.SECURITY_PROTOCOL, "ssl");
hashEnvironment.Add(LookupContext.SSL_TARGET_HOST_NAME, serverUrl);
hashEnvironment.Add(LookupContext.SSL_STORE_TYPE, EMSSSLStoreType.EMSSSL_STORE_TYPE_FILE);
hashEnvironment.Add(LookupContext.SSL_STORE_INFO, StoreInfo);
ILookupContext lcxt = new LookupContext(hashEnvironment);
QueueConnectionFactory queueFactory = null;
queueFactory = contextLookup == string.Empty ? new TIBCO.EMS.QueueConnectionFactory(serverUrl) : (QueueConnectionFactory)lcxt.Lookup(contextLookup);
QueueConnection connection = queueFactory.CreateQueueConnection(userName, password);
This line of Code =
queueFactory = contextLookup == string.Empty ? new TIBCO.EMS.QueueConnectionFactory(serverUrl) : (QueueConnectionFactory)lcxt.Lookup(contextLookup);
is throwing error saying –
TIBCO.EMS.ServiceUnavailableException: ‘Failed to query Naming server: Failed to connect via SSL to [ssl://emsas1t:27221]: Failed to connect via SSL to [ssl://emsas1t:27221]: The system cannot find the path specified.’
So trying to understand what is missing piece here, or how to connect to Tibco EMS server using .Net Code C#. Thanks is advance…!!