Handle SSL/TLS Authentication

You can use macros to configure SSL/TLS connections.

This sample shows how to automatically convert telnet sessions for a specific host to secure SSL connections when the sessions are opened.

This sample applies only to IBM terminals

 To run this sample

  1. Open an IBM session in InfoConnect and then open the Visual Basic Editor.
  2. Select the Common project folder, and then open the InfoConnect Objects folder.
  3. Copy the following code into the ThisFrame code window.
Convert aTelnet Session to SSL
Copy Code
        
Private Sub Frame_ViewOpened(ByVal sender As Variant, ByVal view As Attachmate_Reflection_Objects.view)
    Dim terminal As Attachmate_Reflection_Objects_Emulation_IbmHosts.ibmTerminal
    Dim HostAddress As String
   
    'Apply security only to IbmTerminal (IBM3270 or IBM5250) sessions
    If TypeName(view.control) = "IbmTerminal" Then
  
        Set terminal = view.control
        HostAddress = terminal.HostAddress
     
        With terminal
            'If security is not enabled and the host name starts with XYZ, change to a secure session
            If .EnableTelnetEncryption = False And Left(UCase(Trim(HostAddress)), 3) = "XYZ" Then
               
                'Make sure the terminal is disconnected before changing settings
                If .IsConnected = True Then
                .Disconnect
                End If
               
                .EnableTelnetEncryption = True
                .TelnetEncryptionVerifyHostName = False
                .HostAddress = "xyz.exampleDomain.com"
                .Port = 723
               
                'Connect after changing the settings
                .Connect
               
            End If
        End With
         
    End If
End Sub

  1. Replace the XYZ placeholder with your host name and change the value in the Trim function from 3 to the length of your host name. Then replace the placeholders for the HostAddress and Port properties with your host name and its secure port.
  2. Select File and then Save Common to save the macro.
  3. Back in the InfoConnect user interface, open a Reflection IBM session that is configured to connect through Telnet to the host name you entered in the code.
    The session is converted to an SSL session.

 

 

 

See Also

 

 


2015 Attachmate