Avatar

Please consider registering
guest

sp_LogInOut Log In sp_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 RSS sp_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: 983
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: 518

Currently Online:
41 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 681

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com

Moderators: Jouni Aro: 1010, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1