Our applications cannot poll OPC DA server (running on the SAME MACHINE) ONLY in asynchronous mode, because of (got from Windows Event Viewer -> Windows Logs -> System)
The server-side authentication level policy does not allow the user
DESKTOP-AAAAA\Admin SID (S-1-5-21-239355189-745547292-2783995333-1001)
from address 192.168.0.5 to activate DCOM server.
Please raise the activation authentication level at least to
RPC_C_AUTHN_LEVEL_PKT_INTEGRITY in client application.
This is because of tricky and buggy Microsoft DCOM hardening. Thus our application already uses the highest authentication level (higher than RPC_C_AUTHN_LEVEL_PKT_INTEGRITY
) and DCOM settings are configured according to recommendation of OPC DA Server provider (Matricon Simulation in our case).
From the error above I can conclude that j-interop
(or something else in calling chain) uses wrong IP address of my machine, thus Windows applies wrong authentication rules. Because both the our application and OPC DA server run on the same machine, so I initialized JiSession
with 127.0.0.1
as target host. But the error shows that request is from 192.168.0.5
- the IP of my WiFi adapter (by the way, my machine hasn't static IP):
$ ipconfig
....
Wireless LAN adapter:
Connection-specific DNS Suffix . :
IPv6 Address. . . . . . . . . . . : 2a02:2698:582b:1606:91d4:8c27:683f:333f
Temporary IPv6 Address. . . . . . : 2a02:2698:582b:1606:8042:9881:a089:37e3
Link-local IPv6 Address . . . . . : fe80::ac0:a10c:425:4577%8
IPv4 Address. . . . . . . . . . . : 192.168.0.5
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : fe80::1%8
After digging into j-interop
source code, I found it supports only ncacn_ip_tcp
RPC endpoint disregarding remote address or localhost. For the latter j-interop
might use ncalrpc
RPC endpoint. I guess it could be the root cause of the error mentioned at the begging on the question.
At the moment my questions are:
- Did anyone try to force
j-interop
usingncalrpc
for127.0.0.1
(i.e. localhost)? - Or maybe someone solved the error of authentication level check?