splatch commented on issue #1802:
URL: https://github.com/apache/plc4x/issues/1802#issuecomment-2416606633

   After disabling security I've managed to connect. I could not confirm yet, 
if encrypted communications works as expected.
   
   My connection string is 
`opcua:tcp://DESKTOP-OM18VQ9:4841?discovery=true&security-policy=NONE&message-security=NONE`.
   I've used simulated OPC tag called `Address Space.Dev00.Tag000`.
   
   Test code:
   ```
           try (PlcConnection connection = new 
DefaultPlcDriverManager().getConnection("opcua:tcp://DESKTOP-OM18VQ9:4841?discovery=true&security-policy=NONE&message-security=NONE"))
 {
               CompletableFuture<? extends PlcSubscriptionResponse> future = 
connection.subscriptionRequestBuilder()
                   .addChangeOfStateTagAddress("c", "ns=4;s=Address 
Space.Dev00.Tag000")
                   .build().execute();
               future.whenComplete((r, e) -> {
                   if (e != null) {
                       e.printStackTrace();
                       return;
                   }
                   r.getSubscriptionHandle("c").register(event -> {
                       for (String field : event.getTagNames()) {
                           System.out.println("Received state update: " + field 
+ " " + event.getObject(field) + " " + event.getResponseCode(field));
                       }
                   });
               }).get();
               Thread.sleep(600_000);
               System.out.println("Closing connection");
           } catch (PlcConnectionException e) {
               throw new PlcRuntimeException(e);
           } catch (Exception e) {
               e.printStackTrace();
           }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to