Skip to main content

Sample code with descriptions on how to activate secure connections using ObjectX and Web To Host.

Problem:

Custom code to activate secure connections in Rumba and Web To Host.

Resolution:

The two samples provided show secure connection settings in bold.

HTML sample:

<HTML>
<TITLE>Mainframe Pro session</TITLE>
<HEAD>
<!--
//-->
<SCRIPT type="text/javascript">
function init()
{
CPHost.AutoConnect = false;
CPHost.SourceName = "prosession";
CPHost.DevID ="8502398975199317070";
CPHost.kc1 = "00800-A00O4B-HR19Z";
CPHost.kc2 = "";
CPHost.kc3 = "F207";
CPHost.kc4 = "7ebc5ecfe1bbbf457ec352bdfcdeac4477d6";

// CPHost.kc4 = "00800-A00O4B-HR19Z";
CPHost.MainToolbarEnabled = true;
CPHost.ContainerContextMenuEnabled = true;
CPHost.MFFileTransferEnabled = true;
CPHost.UserMacrosEnabled = true;
CPHost.UserMacroEditRecordEnabled = true;
CPHost.HideMacroCancelButton = false;
CPHost.EnableNonDisplayFieldPrompt = true;
CPHost.ApplicationPrintPasteEnabled = true;
CPHost.ColorSelectionEnabled = true;
CPHost.KeyboardMapperEnabled = true;
CPHost.EnableEditOptions = true;
CPHost.ConfigureDisplayEnabled = true;
CPHost.UserWatermarkEnabled = true;
CPHost.UserScriptsEnabled = false;
CPHost.UserScriptEditRecordEnabled = true;
CPHost.LocalHelpFilesEnabled = "true";
CPHost.CreateSession(1);

CPHost.ObjectXHostInterface.StartupModelType = 4;
CPHost.InterfaceName = "WallData.TN3270Link";
CPHost.ObjectXRumbaControl.HostInterface.Interface.InsertName2("HOSTNAME.NETWORK.COM");
CPHost.DeviceName = "";
ti = CPHost.ObjectXTelnetInterface;
CPHost.ObjectXRumbaControl.HostInterface.Interface.TelnetPort = 23;
CPHost.ObjectXTelnetInterface.ExtendedAttributes = true;
CPHost.ExtendedAttributes = true;
CPHost.ConnectTimeout = 120;

// SSL/SSH main code
var si = CPHost.ObjectXSecurityInterface;
// mainframe specific code
var sec_session = si.MFTelnet2;
//session General security Parameters
sec_session.HostName = "HOSTNAME.NETWORK.COM";             Set host name
sec_session.HostPort = 23;                                 Set connection port
sec_session.TraceLevel = 0;                                Enable tracing (0-5) Used for debugging purposes production code should be set to 0
sec_session.UserInteractive = false;                       Enable pop up dialogs (True/False)
sec_session.Language = 1033;                               Set language
// SSL Parameters
var siProtocol = si.SSL;
siProtocol.MatchHostNameInCert = false;                    The Cert principle name must match the DNS name for the host (True/False)
siProtocol.TrustAllIssuersInCert = false;                  The Entire certificate chain should be trusted (True/False)
siProtocol.ValidDatesInCert = false;                       The Dates on the certificate must be valid (True/False)
sec_session.AttachSecurityProtocol(siProtocol.Serialized); Assign the encryption interface information to the Display interface
CPHost.SetSecurityType(0);                                 Set Security type (Type 0 =SSL 1=SSH)
ti.SecurityString = sec_session.Serialized;
//end SSL/SSH code

CPHost.ObjectXMFFtxInterface.AutoList = false;
CPHost.ObjectXMFFtxInterface.AnimationsEnabled = false;
CPHost.ObjectXMFFtxInterface.ScreenVerification = false;
CPHost.ObjectXMFFtxInterface.TemplatesEnabled = true;
CPHost.ObjectXMacroInterface.ShowProgress = false;
CPHost.TrappedKeys="Ctrl O,Ctrl L,Ctrl N,Ctrl P,Ctrl W,Ctrl S,Ctrl E,Ctrl I,Ctrl H,Ctrl X,Alt Home";
CPHost.KBDLangID = 999;
CPHost.MenubarAndToolbarsEnabled = true;
CPHost.CustomizeToolbarsEnabled = true;
CPHost.CustomButtonsEnabled = true;
CPHost.ObjectXRumbaControl.ShowLightPenCursor = false;
CPHost.ObjectXRumbaControl.LightPen = 0;
CPHost.ZoomEnabled = false;
CPHost.TypeAhead = true;
CPHost.ObjectXKeyboardInterface.AutoReset=true;
CPHost.SmartInsert = true;
CPHost.WordWrap = true;
CPHost.ObjectXRumbaControl.Clipboard.textformat = true;
CPHost.ObjectXRumbaControl.Clipboard.BIFFFormat = true;
CPHost.ObjectXRumbaControl.Clipboard.BitmapFormat = true;
CPHost.ObjectXRumbaControl.Clipboard.MetafileFormat = true;
CPHost.ObjectXRumbaControl.Clipboard.PasteLinkFormat = true;
CPHost.ObjectXRumbaControl.Clipboard.ParseDataOnBoundaries = 1;
CPHost.ObjectXRumbaControl.Clipboard.PasteTextWrapping = true;
CPHost.ObjectXRumbaControl.Clipboard.SaveOriginalFieldSpacing = true;
CPHost.ObjectXRumbaControl.AutoFont = true;
CPHost.ObjectXRumbaControl.AutoFontMinimumWidth = 2;
CPHost.ObjectXRumbaControl.SetFocus();
CPHost.ObjectXRumbaControl.RDE_Connect_HSynch(true, 4, 0, "Systems require authorization", 2, 2);
}
</SCRIPT>
</HEAD>
<BODY onLoad="init()">
<OBJECT classid="CLSID:913B101A-EDD1-11D5-AD4A-0060B0FB4900" ID="CPHost" name=CPHost
style="LEFT: 0px; TOP: 0px" type=application/x-oleobject Height=100% Width=100%>
<param name="_Version" value="65536">
<param name="SessionID" value="0">
<param name="_ExtentX" value="2646">
<param name="_ExtentY" value="1323">
<param name="_StockProps" value="0">
</BODY>
</HTML>

VB Sample

Private Sub Connect_Click()

    Dim ifcTN As ObjectXConfigureTn3270Link
    Dim SecParms As Object
    Dim SecIface As Object
    Dim SecSSL As Object
    Dim bRC As Boolean
    
    MFDsp1.HostInterface.Name = "WallData.TN3270Link"
    
    'Configure the Display standard interface
    Set ifcTN = MFDsp1.HostInterface.Interface
    bRC = ifcTN.InsertName2("os390b.netmanage.com")
    
    ifcTN.TelnetPort = 992 'Standard SSL port
    
    'Enable SSL
    'Get the RSS Security object
        
    Set SecParms = CreateObject("NMSecurityBase.Factory2")
    Set SecIface = SecParms.MFTelnet2
    SecIface.HostName = "HOSTNAME.NETWORK.COM"             'Change to your host name
    
    SecIface.HostPort = 992                                'Standard SSL telnet port
                                                           'Only needed if troubleshooting
                                                           'will create a wdwsock.log file in the temp directory
    SecIface.TraceLevel = 5                                'Enable tracing production code should be 0
    SecIface.UserInteractive = False                       'Don't pop up any dialogs
    SecIface.Language = 1033                               'English
    
    Set SecSSL = SecParms.SSL
                                                           'Set as desired
'These settings determine how strict the SSL engine should be in validating the host certificate.  If initial connect fails, it is useful to set these all to "False" for troubleshooting, 
‘then enable each one at a time.
    SecSSL.MatchHostNameInCert = False                     'The Cert principle name must match the DNS name for the host.
    SecSSL.TrustAllIssuersInCert = False                   'The Entire certificate chain should be trusted/ignored (True/False)
    SecSSL.ValidDatesInCert = False                        'The Dates on the certificate must be valid
    SecIface.AttachSecurityProtocol SecSSL.Serialized      'Enable SSL in the Security interface
    ifcTN.SecurityString = SecIface.Serialized             'Assign the encryption interface information to the Display interface

    MFDsp1.Connect
    
End Sub

Incident Number: N/A

Old KB# 14891

#Web-to-Host
#Rumba
#ProClient
#SupportTips/KnowledgeDocs