opcua key length mismatch
# umh-support
PLC: Siemens 1500 encryption: SignAndEncrypt nodeIds configured but not relevant yet I think What info does UMH need to help fix this?
Would it make a difference if i deploy it as container outside of the UMH management? other tools can succesfully connect to the opcua server
I've tried with multiple server profiles (siemens-s7-1500, auto and high-performance)
k
Hi, looks like the server uses some older security policies. Do you have access to the PLC and can check which ones are enabled?
d
Are you using the correct security mode and and policy?
j
it is actually a known bug that I jsut fixed in the upstream gopcua lirbary, give me some time then i can post an update
from my klaus: Hi Diederik, this is a known bug in the OPC UA library underneath the bridge (gopcua), not in your config. Your S7-1500 lists several username token policies, with the old Basic128Rsa15 first. The library takes the first one, and Basic128Rsa15 only allows keys up to 2048 bits, while your PLC certificate is 3072 bits. So the secure channel itself (Basic256Sha256) is fine, and only encrypting the password fails. Switching security mode, policy or server profile won't change that, and neither will running the container outside UMH. Workaround until the fix ships: in TIA Portal, disable Basic128Rsa15 in the PLC's OPC UA server security policies, so the legacy username policy disappears. If that's not possible, give the PLC a 2048-bit server certificate. The fix is merged upstream (https://github.com/gopcua/opcua/issues/912, fixed by #914). It reaches the bridge with the next gopcua release and the umh-core release after it. We're testing a release candidate soon; if you'd be up for trying that build against your 1500, let me know.
d
Workaround until the fix ships: in TIA Portal, disable Basic128Rsa15 in the PLC's OPC UA server security policies, so the legacy username policy disappears. If that's not possible, give the PLC a 2048-bit server certificate. FYI, this is not true, i tried this https://cdn.discordapp.com/attachments/1572368867538243634/1572671817234259968/image.png?ex=6aff3844&is=6afde6c4&hm=7266fc2289f67928a643d6e42aea34517c4ebca52ec7ec6243458e8d21543438&
I'm not an expert in this but am i correct that the security policy on the username different than the security policy on the password? TIA only allows to set one (the password then I suppose?)
open to try the release candidate tomorrow already. Lets do this over a call
j
Okay then let’s check. Maybe you have found a second bug here
d
Endpoint dump from the 1500 (asyncua, GetEndpoints): Endpoint: SignAndEncrypt Basic256Sha256 cert=3072 bit 1. UserName UserName_Basic128Rsa15_Token Basic128Rsa15 2. UserName UserName_Basic256_Token Basic256 3. UserName UserName_Basic256Sha256_Token Basic256Sha256 4. UserName UserName_Aes128Sha256RsaOaep_Token Aes128_Sha256_RsaOaep 5. UserName UserName_Aes256Sha256RsaPss_Token Aes256_Sha256_RsaPss Only one endpoint, but all five UserName token policies are still advertised, so disabling Basic128Rsa15 in TIA doesn’t remove the legacy token. That’s why the workaround didn’t work. Token 3 matches the channel, so #914 should pick it. Can you confirm the RC includes gopcua aeb3410? Happy to test tomorrow.
update: the new build fixes this (umh-core:sha-65b737e)