{"id":1027,"date":"2019-05-14T14:14:09","date_gmt":"2019-05-14T12:14:09","guid":{"rendered":"https:\/\/blog2.basyskom.com\/?p=1027"},"modified":"2024-07-30T14:14:41","modified_gmt":"2024-07-30T12:14:41","slug":"secure-connections-with-qt-opc-ua","status":"publish","type":"post","link":"https:\/\/www.basyskom.de\/en\/secure-connections-with-qt-opc-ua\/","title":{"rendered":"Secure Connections with Qt OPC UA"},"content":{"rendered":"<div data-elementor-type=\"wp-post\" data-elementor-id=\"1027\" class=\"elementor elementor-1027\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-44a23228 elementor-section-boxed elementor-section-height-default elementor-section-height-default wpr-particle-no wpr-jarallax-no wpr-parallax-no wpr-sticky-section-no wpr-equal-height-no\" data-id=\"44a23228\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-6ab01373\" data-id=\"6ab01373\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-56703ae8 elementor-widget elementor-widget-text-editor\" data-id=\"56703ae8\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\n<p>Starting with the Qt 5.13 release, due end of May, the Qt OPC UA API in combination with the Unified Automation backend officially supports secure connections to servers (Sign or SignAndEncrypt message security mode). The following article outlines the changes to the Qt OPC UA API and shows how to get secure connections also with the open62541 backend.<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter wp-image-1791 size-large\" src=\"https:\/\/www.basyskom.de\/wp-content\/uploads\/2020\/02\/csm_opcua_basysKom_keyvisual_9e47f535dc-1024x383.jpg\" alt=\"Qt OPC UA\" width=\"1024\" height=\"383\" srcset=\"https:\/\/www.basyskom.de\/wp-content\/uploads\/2020\/02\/csm_opcua_basysKom_keyvisual_9e47f535dc-1024x383.jpg 1024w, https:\/\/www.basyskom.de\/wp-content\/uploads\/2020\/02\/csm_opcua_basysKom_keyvisual_9e47f535dc-300x112.jpg 300w, https:\/\/www.basyskom.de\/wp-content\/uploads\/2020\/02\/csm_opcua_basysKom_keyvisual_9e47f535dc-768x288.jpg 768w, https:\/\/www.basyskom.de\/wp-content\/uploads\/2020\/02\/csm_opcua_basysKom_keyvisual_9e47f535dc-1536x575.jpg 1536w, https:\/\/www.basyskom.de\/wp-content\/uploads\/2020\/02\/csm_opcua_basysKom_keyvisual_9e47f535dc.jpg 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n\n<h2 class=\"wp-block-heading\">Security related QOpcUaClient API changes<\/h2>\n\n<p>To enable secure connections a number of changes to the API of the QOpcUaClient were necessary &#8211; some of them preventing existing code from compiling. In summary:<\/p>\n\n<ul class=\"wp-block-list\">\n<li>The <strong>connectToEndpoint()<\/strong> method which takes a QUrl parameter has been removed. The only supported way to specify which server to connect to is now via an endpoint description retrieved using <strong>requestEndpoints()<\/strong>.<\/li>\n<li><strong>supportedSecurityPolicies()<\/strong> returns a list with the OPC UA security policies supported by the current backend.<\/li>\n<li><strong>setPkiConfiguration()<\/strong> is used to configure QOpcUaClient with a client certificate, a corresponding private key and the necessary data to verify server certificates.<\/li>\n<li><strong>setIdentity()<\/strong> configures the identity information QOpcUaClient provides to the server during the connect. This information can also be initialized from the client certificate.<\/li>\n<li>Up to Qt 5.12, login credentials were supplied to QOpcUaClient by encoding username and password in the URL. <strong>setAuthenticationInformation()<\/strong> replaces this by a clean API which can be used to select anonymous, username and password or X509 certificate based authentication.<\/li>\n<li>The <strong>connectError()<\/strong> signal is emitted when a connection to a server fails. Depending on the error, the connected slot is able to override it (for example an untrusted or no longer valid server certificate).<\/li>\n<li><strong>If the private key is protected with a password, the passwordForPrivateKeyRequired()<\/strong> signal is emitted. The user can then supply the password in the connected slot.<\/li>\n<\/ul>\n\n<p><\/p><\/div><\/div><\/div><\/div><\/div><\/section><\/div> <a href=\"https:\/\/www.basyskom.de\/en\/secure-connections-with-qt-opc-ua\/#more-1027\" class=\"more-link elementor-more-link\"><span aria-label=\"Continue reading Secure Connections with Qt OPC UA\">(more&hellip;)<\/span><\/a>","protected":false},"excerpt":{"rendered":"<p>Starting with the Qt 5.13 release, due end of May, the Qt OPC UA API in combination with the Unified Automation backend officially supports secure connections to servers (Sign or SignAndEncrypt message security mode). The following article outlines the changes to the Qt OPC UA API and shows how to get secure connections also with the open62541 backend.<\/p>","protected":false},"author":4,"featured_media":1791,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[2,230,8],"tags":[124,15,123],"class_list":["post-1027","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","category-opc-ua","category-qt","tag-opc-ua","tag-qt","tag-qt-opc-ua"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.basyskom.de\/en\/wp-json\/wp\/v2\/posts\/1027","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.basyskom.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.basyskom.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.basyskom.de\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.basyskom.de\/en\/wp-json\/wp\/v2\/comments?post=1027"}],"version-history":[{"count":6,"href":"https:\/\/www.basyskom.de\/en\/wp-json\/wp\/v2\/posts\/1027\/revisions"}],"predecessor-version":[{"id":11183,"href":"https:\/\/www.basyskom.de\/en\/wp-json\/wp\/v2\/posts\/1027\/revisions\/11183"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.basyskom.de\/en\/wp-json\/wp\/v2\/media\/1791"}],"wp:attachment":[{"href":"https:\/\/www.basyskom.de\/en\/wp-json\/wp\/v2\/media?parent=1027"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.basyskom.de\/en\/wp-json\/wp\/v2\/categories?post=1027"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.basyskom.de\/en\/wp-json\/wp\/v2\/tags?post=1027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}