Mark Hartley Posted January 13, 2023 Share Posted January 13, 2023 My company has a Java version of the of our app that uses two properties/methods to accomplish this, com.tibco.tibjms.TibjmsConnectionFactory().setSSLEnableVerifyHost(false) and com.tibco.tibjms.TibjmsConnectionFactory().setSSLEnableVerifyHostName(false). The .NET API does not appear to have these properties/methods. Can anyone give me code samples of how to connect via SSL but not use a cert? Link to comment Share on other sites More sharing options...
Mark Hartley Posted January 13, 2023 Author Share Posted January 13, 2023 I found the answer myself. In my case, the problem was that EMSSSL.SetTargetHostName() needed to be set with the entire url, without ssl:// and port. I was confused with this since there was no cert that I could get the TargetHostName from. Link to comment Share on other sites More sharing options...
grace99 Posted February 20 Share Posted February 20 In .NET, if you're using the TIBCO EMS messaging system, you can use the 'Tibco.EMS.dll' library for EMS connections. To connect via SSL without verifying the host name or certificate, you can set the appropriate properties in the 'Tibco.EMS.ConnectionFactory' class. Here is an example of how you can achieve this in C#: using System; using Tibco.EMS; // Make sure to add reference to Tibco.EMS.dll class Program { static void Main() { // Set your EMS server URL string serverUrl = "tcp://your.ems.server:7222"; // Create connection factory Tibco.EMS.ConnectionFactory factory = new Tibco.EMS.ConnectionFactory(serverUrl); // Set SSL properties to disable certificate verification factory.SetIntProperty(Tibco.EMS.ConnectionProperty.SSL_TRACE_LEVEL, Tibco.EMS.SSLTraceLevel.DATA); factory.SetBoolProperty(Tibco.EMS.ConnectionProperty.SSL_ENABLE_VERIFY_HOST, false); factory.SetBoolProperty(Tibco.EMS.ConnectionProperty.SSL_ENABLE_VERIFY_HOSTNAME, false); // Create connection Tibco.EMS.Connection connection = factory.CreateConnection(); try { // Start the connection connection.Start(); // Perform your messaging operations here } catch (Tibco.EMS.EMSException ex) { Console.WriteLine($"Error: {ex.Message}"); } finally { // Close the connection when done connection.Close(); } } } Make sure to replace ' "tcp://your.ems.server:7222" ' with your actual EMS server URL. Note that if you disabling SSL verification that can introduces security risks, and it is crucial to understand the implications before using this in a production environment. If possible, it is recommended to use proper SSL certificate validation for secure communication. Disabling SSL verification should be done cautiously and only in scenarios where security constraints allow for it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now