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: 1026
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:
15 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: 735

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1523

Posts: 6449

Newest Members:

rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerley, Thomassnism, biancacraft16

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0

Administrators: admin: 1