Skip to content

Unable to connect to KEPServerEX with Encryption, Username, and Password #1581

Closed Answered by JamesTann
JamesTann asked this question in Q&A
Discussion options

You must be logged in to vote

I was able to eventually figure out my issue through some trial and error. This was my result:

    # paths to certificate and private key
    cert_base = Path(__file__).parent.parent / "certs"
    cert = Path(cert_base / "public" / "cert.der")
    private_key = Path(cert_base / "private" / "key.pem")

    # configure the client
    client = Client(url=settings.opcua_url)
    client.set_user(settings.opcua_username)
    client.set_password(settings.opcua_password)
    client.application_uri = CLIENT_APP_URI
    await client.set_security(
        SecurityPolicyBasic256Sha256,
        certificate=str(cert),
        private_key=str(private_key),
    )

    # load the trust store
    trust_sto…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by JamesTann
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant