18:48, EEST
June 12, 2018
In the Prosys OPC UA Java SDK – Server Tutorial is written:
If your application does not use security, you may also create the identity without
any certificate by using the default constructor. However, you should always set
the ApplicationDescription to the identity.
But if I try doing this:
….
ApplicationIdentity newIdentity = new ApplicationIdentity();
newIdentity.setApplicationDescription(appDescription);
server.setApplicationIdentity(newIdentity);
server.setSecurityModes(SecurityMode.NON_SECURE);
server.addUserTokenPolicy(UserTokenPolicy.ANONYMOUS);
server.init();
I got following Exception:
Exception in thread “main” java.lang.IllegalArgumentException: null arg
at org.opcfoundation.ua.transport.security.KeyPair.(KeyPair.java:117)
Disconnected from the target VM, address: ‘127.0.0.1:56922’, transport: ‘socket’
at com.prosysopc.ua.ApplicationIdentity.getCertificates(SourceFile:960)
at com.prosysopc.ua.server.UaServer.bj(SourceFile:2116)
at com.prosysopc.ua.server.UaServer.init(SourceFile:1125)
at de.siemens.mcRail.IntermediateServer.IntermediateServer.initialize(IntermediateServer.java:204)
at de.siemens.mcRail.IntermediateServer.IntermediateServer.main(IntermediateServer.java:57)
Whats going wrong?
12:06, EEST
April 3, 2012
Hi,
Sorry, the tutorial is incorrect.
You will have to define a certificate in all cases, even though it would not be used in None/Anonymous combination (a combination of None + any other user auth mode needs it). It is still part in the Endpoint definition and currently those cannot be done in the stack layer without defining any certificates.
We can most likely fix this in a future version.
If there is a use-case in which creating e.g. a self-signed certificate with expiry in like 100+ years would not be a working workaround, please let me know.
Most Users Ever Online: 1919
Currently Online:
17 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 727
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
ellis87832073466, zkxwilliemae, gabriellabachus, Deakin, KTP25Zof, Wojciech Kubala, efrennowell431, wilfredostuart, caitlynfajardo, jeromechubb7Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1