Avatar
Please consider registering
guest
sp_LogInOut Log Insp_Registration Register
Register | Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Feed Topic RSSsp_TopicIcon
Server without certificates
September 11, 2018
18:48, EEST
Avatar
Alex78
Member
Members
Forum Posts: 3
Member Since:
June 12, 2018
sp_UserOfflineSmall Offline

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?

September 12, 2018
12:06, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1045
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Helsinki
Most Users Ever Online: 1919
Currently Online:
Guest(s) 22
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 90
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 733
Moderators: 8
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1545
Posts: 6516
Newest Members:
basilpullman, Richardmip, mood edibles, LouieWreve, daniellabdx, janessan21, sammiebeak359, gena7127517, thorstenbouldin, Brett.Rollason
Moderators: Jouni Aro: 1029, Pyry: 1, Petri: 1, Bjarne Boström: 1045, Jimmy Ni: 26, Matti Siponen: 353, Lusetti: 0, Elias: 0
Administrators: admin: 1