Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

SSL/TLS mit BeagleBone Black, Codesys 3.5.15

CellOHorst
2019-08-15
2019-08-19
  • CellOHorst - 2019-08-15

    Sehr geehrter Herr Schwellinger,

    ich hab nochmal den SecurityAgent ausprobiert, um ein Zertifikat für den Webserver auf dem BBB zu erzeugen.
    Wenn ich das tue, liegt danach ein neu generiertes Zertifikat und ein Schlüssel unter '/var/opt/codesys/.pki/own' auf dem BBB (genau genommen 2 - s. Anhänge).
    Dann flugs die Codesyscontrol.cfg umgestellt:

    [CmpWebServer]
    ConnectionType=3

    Und Neustart.

    Im Log steht dann Folgendes:

    Schnipp....

    2019-08-15T18:22:35Z, 0x00000124, 1, 0, 0, Security policy allows plain text communication. Secure communication is deactivated.
    2019-08-15T18:22:35Z, 0x00000124, 1, 0, 0, **********
    2019-08-15T18:22:35Z, 0x00000124, 1, 0, 0, OPC UA Server Started:
    2019-08-15T18:22:35Z, 0x00000124, 1, 0, 0, Hostname: CM_CONTROL, Port: 4840
    2019-08-15T18:22:35Z, 0x00000124, 1, 0, 0, URL: opc.tcp://CM_CONTROL:4840
    2019-08-15T18:22:35Z, 0x00000124, 1, 0, 0, Loopbackadapter activated.
    2019-08-15T18:22:35Z, 0x00000124, 1, 0, 0, All available networkadapters are used.
    2019-08-15T18:22:35Z, 0x00000124, 1, 0, 0,
    *********
    2019-08-15T18:22:35Z, 0x00000124, 1, 0, 0, Provider CODESYS_DefaultProvider with Version 0x3050f00 registerd at the OPC UA server.
    2019-08-15T18:22:35Z, 0x00005f0d, 1, 0, 1, registered interface <interface>can0</interface> as can network 0
    2019-08-15T18:22:35Z, 0x00005f0d, 1, 0, 1, registered interface <interface>can1</interface> as can network 1
    2019-08-15T18:22:35Z, 0x00000124, 1, 0, 0, Provider CmpOPCUAProviderIecVarAccess with Version 0x3050f00 registerd at the OPC UA server.
    2019-08-15T18:22:37Z, 0x00000126, 1, 0, 0, Valid license found for OPC UA IecVarAccess provider.
    2019-08-15T18:22:37Z, 0x00000002, 1, 0, 22, No retain area in bootproject of application [<app>Application</app>]
    2019-08-15T18:22:37Z, 0x00000002, 1, 0, 6, Bootproject of application [<app>Application</app>] loaded
    2019-08-15T18:22:37Z, 0x00000018, 1, 0, 1, Setting router <instance>0</instance> address to

    (0000:4a04)

    2019-08-15T18:22:37Z, 0x00000018, 1, 0, 1, Setting router <instance>1</instance> address to
    (2ddc:c0a8:4a04)

    2019-08-15T18:22:37Z, 0x00000002, 1, 0, 10, Application [<app>Application</app>] started
    2019-08-15T18:22:37Z, 0x00000001, 1, 0, 34, CODESYS Control ready
    2019-08-15T18:22:37Z, 0x00001021, 1, 18, 8, <p0>1</p0><p1>1</p1><p2>129</p2>
    2019-08-15T18:22:37Z, 0x00001021, 1, 18, 9, <p0>1</p0><p1>1</p1>
    2019-08-15T18:22:37Z, 0x00001021, 1, 16, 22, <p0>1</p0>
    2019-08-15T18:22:37Z, 0x00001021, 1, 65554, 8, <p0>1</p0><p1>2</p1><p2>129</p2>
    2019-08-15T18:22:37Z, 0x00001021, 1, 65554, 9, <p0>1</p0><p1>2</p1>
    2019-08-15T18:22:37Z, 0x00001021, 1, 131090, 8, <p0>1</p0><p1>3</p1><p2>129</p2>
    2019-08-15T18:22:37Z, 0x00001021, 1, 131090, 9, <p0>1</p0><p1>3</p1>
    2019-08-15T18:22:38Z, 0x0000101f, 4, 15, 7,
    ERROR: <p0>1</p0><p1>4</p1>
    2019-08-15T18:22:38Z, 0x0000100c, 1, 0, 0, Visuinitialization starting.
    2019-08-15T18:22:38Z, 0x0000101f, 4, 15, 6,
    ERROR: <p0>1</p0>
    2019-08-15T18:22:38Z, 0x0000101f, 1, 15, 12, <p0>1</p0>
    2019-08-15T18:22:38Z, 0x0000101f, 1, 15, 11, <p0>1</p0>
    2019-08-15T18:22:39Z, 0x0000100c, 1, 0, 0, Visuinitialization done.
    2019-08-15T18:22:39Z, 0x00000071, 1, 0, 0,
    ********
    2019-08-15T18:22:39Z, 0x00000071, 1, 0, 0, Web Server
    2019-08-15T18:22:39Z, 0x00000071, 1, 0, 0, Root directory : $PlcLogic$/$visu$
    2019-08-15T18:22:39Z, 0x00000071, 1, 0, 0, Host : CM_CONTROL
    2019-08-15T18:22:39Z, 0x00000071, 1, 0, 0, HTTP port : 9090
    2019-08-15T18:22:39Z, 0x00000071, 1, 0, 0, HTTPS port : 443
    2019-08-15T18:22:39Z, 0x00000071, 1, 0, 0, Connection type : REDIRECT_HTTP_TO_HTTPS
    2019-08-15T18:22:39Z, 0x00000071, 1, 0, 0,
    ********
    2019-08-15T18:22:39Z, 0x00000033, 4, 1, 0,
    ERROR: TlsCreateContext: Failed to read certificate './PKI/cert/server.cer' in namespace: 'WebServer'.
    2019-08-15T18:22:39Z, 0x00000033, 4, 1, 0,
    *** ERROR: TlsCreateContext: Creating the TLS context for namespace 'WebServer' failed.
    2019-08-15T18:22:39Z, 0x00001021, 1, 18, 16, <p0>1</p0><p1>1</p1>

    ...Schnapp

    Offensichtlich wird in '../PKI' und nicht in '../.pki' gesucht. Die codesyscontrol.cfg ist ansonsten unverändert.

    Dass das vom Security-Agent generierte Zertifikat die Endung '.der' hat (s. Anhang), ist aber OK, oder?

    Die Uhr wurde übrigens stets vor Aufstarten des codesyscontrol.bin per ntpdate gestellt (Start-Script in jedem Falle vorher - sieht man ja auch im Log) - und das Zertifikat ist 10 Jahre gültig...

    Viele Grüße,
    Horst Noecker

    IMG: key.png

    IMG: cert.png

    IMG: Nach_Zert.png

    IMG: Vor_Zert.png

     
  • eschwellinger

    eschwellinger - 2019-08-19

    Hallo Herr Noecker,
    am besten Sie schreiben einen BugReport im CODESYS Store -> meine Frage -> BugSupport,
    hier wird dann dafür ein Fehler Eingetragen.

    Grüße
    Edwin Schwellinger

     

Log in to post a comment.