Skip to content

Commit

Permalink
Server doesn't start up with mixed https endpoints (#2789)
Browse files Browse the repository at this point in the history
* allow startup of mixed https endpoints
  • Loading branch information
mregen authored Oct 10, 2024
1 parent a29d871 commit 23b8502
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<!-- Where the application instance certificate is stored (MachineDefault) -->
<ApplicationCertificate>
<StoreType>Directory</StoreType>
<StorePath>%LocalApplicationData%/OPC Foundation/pki/own</StorePath>
<StorePath>%LocalApplicationData%/OPC Foundation/pki/own</StorePath>
<SubjectName>CN=Quickstart Reference Server, C=US, S=Arizona, O=OPC Foundation, DC=localhost</SubjectName>
</ApplicationCertificate>

Expand Down Expand Up @@ -77,6 +77,7 @@
<BaseAddresses>
<ua:String>opc.https://localhost:62540/Quickstarts/ReferenceServer</ua:String>
<ua:String>opc.tcp://localhost:62541/Quickstarts/ReferenceServer</ua:String>
<!--<ua:String>https://localhost:62542/Quickstarts/ReferenceServer</ua:String>-->
</BaseAddresses>
<!--
These list the alternate addresses (via firewalls, multiple NICs etc.) that can be
Expand Down
5 changes: 5 additions & 0 deletions Stack/Opc.Ua.Bindings.Https/Stack/Https/HttpsServiceHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ X509Certificate2Collection instanceCertificateChain
continue;
}

if (!baseAddresses[ii].StartsWith(UriScheme, StringComparison.Ordinal))
{
continue;
}

UriBuilder uri = new UriBuilder(baseAddresses[ii]);

if (uri.Path[uri.Path.Length - 1] != '/')
Expand Down

0 comments on commit 23b8502

Please sign in to comment.