Backed out changeset c6068b674b30 wxPython4
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Thu, 03 Nov 2022 17:43:30 +0100
branchwxPython4
changeset 3652 b5c6bb72bfc9
parent 3643 c6068b674b30
child 3657 e0d6f5f0dcc2
Backed out changeset c6068b674b30
opc_ua/client.py
opc_ua/opcua_client_maker.py
--- a/opc_ua/client.py	Tue Oct 25 18:51:45 2022 +0200
+++ b/opc_ua/client.py	Thu Nov 03 17:43:30 2022 +0100
@@ -67,7 +67,6 @@
                       </xsd:sequence>
                       <xsd:attribute name="Certificate" type="xsd:string" use="optional" default="certificate.pem"/>
                       <xsd:attribute name="PrivateKey" type="xsd:string" use="optional" default="private_key.pem"/>
-                      <xsd:attribute name="ApplicationUri" type="xsd:string" use="optional"/>
                     </xsd:complexType>
                   </xsd:element>
                   <xsd:element name="UserPassword">
@@ -115,9 +114,6 @@
                 # cryptomaterial is expected to be in project's user provide file directory
                 if name in ["Certificate","PrivateKey"]:
                     value = os.path.join(self.GetCTRoot()._getProjectFilesPath(), value)
-                # ApplicationUri defaults to URI if not set
-                if name == "ApplicationUri" and not value:
-                        value = res["URI"]
                 res[name] = value
 
         return res
--- a/opc_ua/opcua_client_maker.py	Tue Oct 25 18:51:45 2022 +0200
+++ b/opc_ua/opcua_client_maker.py	Thu Nov 03 17:43:30 2022 +0100
@@ -43,8 +43,7 @@
         ("Certificate", "certificate.der"),
         ("PrivateKey", "private_key.pem"),
         ("Policy", "Basic256Sha256"),
-        ("Mode", "SignAndEncrypt"),
-        ("ApplicationUri", "")],
+        ("Mode", "SignAndEncrypt")],
     "UserPassword":[
         ("User", None),
         ("Password", None)]}
@@ -319,7 +318,6 @@
             elif AuthType=="x509":
                 self.client.set_security_string(
                     "{Policy},{Mode},{Certificate},{PrivateKey}".format(**config))
-                self.client.application_uri = config["ApplicationUri"]
 
             self.client.connect()
             self.client.load_type_definitions()  # load definition of server specific structures/extension objects
@@ -574,15 +572,13 @@
     retval = UA_Client_connect(client, uri);
 
 /* Note : Policy is ignored here since open62541 client supports all policies by default */
-#define INIT_x509(Policy, UpperCaseMode, PrivateKey, Certificate, ApplicationUri)                  \\
+#define INIT_x509(Policy, UpperCaseMode, PrivateKey, Certificate)                                  \\
     LogInfo("OPC-UA Init x509 %s,%s,%s,%s", #Policy, #UpperCaseMode, PrivateKey, Certificate);     \\
                                                                                                    \\
     UA_ByteString certificate = loadFile(Certificate);                                             \\
     UA_ByteString privateKey  = loadFile(PrivateKey);                                              \\
                                                                                                    \\
     cc->securityMode = UA_MESSAGESECURITYMODE_##UpperCaseMode;                                     \\
-    UA_String_clear(&cc->clientDescription.applicationUri);                                        \\
-    cc->clientDescription.applicationUri = UA_STRING_ALLOC(ApplicationUri);                        \\
     UA_ClientConfig_setDefaultEncryption(cc, certificate, privateKey, NULL, 0, NULL, 0);           \\
                                                                                                    \\
     retval = UA_Client_connect(client, uri);                                                       \\
@@ -656,10 +652,8 @@
         AuthType = config["AuthType"]
         if AuthType == "x509":
             config["UpperCaseMode"] = config["Mode"].upper()
-            if not config["ApplicationUri"]:
-                config["ApplicationUri"] = config["URI"]
             formatdict["init"] += """
-    INIT_x509({Policy}, {UpperCaseMode}, "{PrivateKey}", "{Certificate}", "{ApplicationUri}")""".format(**config)
+    INIT_x509({Policy}, {UpperCaseMode}, "{PrivateKey}", "{Certificate}")""".format(**config)
         elif AuthType == "UserPassword":
             formatdict["init"] += """
     INIT_UserPassword("{User}", "{Password}")""".format(**config)