Not able to connect to Ignition OPC server from another application

I am trying to connect ignition opc server in 3rd party application, it is giving internal server error and getting time out.


OPC_UA_ENDPOINT = "opc.tcp://:62541"
async def get_client():
client = Client(url=OPC_UA_ENDPOINT )
client.set_user("opcuauser")
client.set_password("password")
client.set_security_string(
"Basic256Sha256,SignAndEncrypt,client_cert.pem,client_key.pem"
)

client = await get_client()
try:
node = client.get_node(node_id)
value = await node.read_value()
return {"node_id": node_id, "value": value}
except Exception as e:
raise HTTPException(status_code=500, detail=str(e))
finally:
await client.disconnect()

By default the OPC-UA server only allows connections from the localhost I believe. And no anonymous connections. Check and adjust settings as needed to suit your situation.

Your OPC-UA endpoint doesn't look like a valid URL to me. Shouldn't it be opc.tcp://127.0.0.1:62541 (missing the IP), or does it just assume it's localhost if no IP is provided? Personally I don't like to leave things like this to assumption and think it should be explicitly called out.

not mentioned the ip address for security reasons