Skip to content

Commit

Permalink
Fix net-v14.1.1.0-core github build failures (net-main -> v14.1.1.0-c…
Browse files Browse the repository at this point in the history
…ore @111754)

[git-p4: depot-paths = "//dev/release.net/coherence-net-v14.1.1.0-core/": change = 112081]
  • Loading branch information
lsho committed Oct 21, 2024
1 parent 75442b3 commit 984c49c
Show file tree
Hide file tree
Showing 6 changed files with 384 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
/*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates.
* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
* https://oss.oracle.com/licenses/upl.
*/
using System;
using System.IO;
using System.Runtime.InteropServices;

using NUnit.Framework;
using Tangosol.Net.Cache;
using Tangosol.Net.Messaging.Impl.NamedCache;
using Tangosol.Util;

namespace Tangosol.Net.Impl
{
Expand All @@ -22,6 +19,25 @@ protected override String TestCacheName
get { return "sslOneWayCacheName"; }
}

[SetUp]
public void SetUp()
{
var configFileName = "assembly://Coherence.Tests/Tangosol.Resources/s4hc-cache-config-ssl.xml";
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
configFileName = "assembly://Coherence.Tests/Tangosol.Resources/s4hc-cache-config-ssl-non-win.xml";
}

var ccf = new DefaultConfigurableCacheFactory(configFileName);
CacheFactory.ConfigurableCacheFactory = ccf;
}

[TearDown]
public void TearDown()
{
CacheFactory.Shutdown();
}

[Test]
public virtual void TestNamedCache()
{
Expand Down
27 changes: 22 additions & 5 deletions tests/Coherence.Core.Tests/Net/Impl/SSLRemoteNamedCacheTests.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
/*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates.
* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
* https://oss.oracle.com/licenses/upl.
*/
using System;
using System.IO;
using System.Collections;
using System.Collections.Specialized;
using System.Runtime.InteropServices;
using System.Threading;

using NUnit.Framework;
using Tangosol.Net.Cache;
using Tangosol.Net.Messaging.Impl.NamedCache;
using Tangosol.Util;

namespace Tangosol.Net.Impl {

Expand All @@ -35,6 +33,25 @@ protected String TwoWayCacheName
set { m_cacheName = value; }
}

[SetUp]
public void SetUp()
{
var configFileName = "assembly://Coherence.Tests/Tangosol.Resources/s4hc-cache-config-ssl.xml";
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
configFileName = "assembly://Coherence.Tests/Tangosol.Resources/s4hc-cache-config-ssl-non-win.xml";
}

var ccf = new DefaultConfigurableCacheFactory(configFileName);
CacheFactory.ConfigurableCacheFactory = ccf;
}

[TearDown]
public void TearDown()
{
CacheFactory.Shutdown();
}

[Test]
public virtual void TestOneWayNamedCache()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
/*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates.
* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
* https://oss.oracle.com/licenses/upl.
*/
using System;
using System.Runtime.InteropServices;
using System.IO;

using NUnit.Framework;
using Tangosol.Net.Cache;
using Tangosol.Net.Messaging.Impl.NamedCache;
using Tangosol.Util;

namespace Tangosol.Net.Impl
{
Expand All @@ -22,6 +20,25 @@ protected override String TestCacheName
get { return "sslTwoWayCacheName"; }
}

[SetUp]
public void SetUp()
{
var configFileName = "assembly://Coherence.Tests/Tangosol.Resources/s4hc-cache-config-ssl.xml";
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
configFileName = "assembly://Coherence.Tests/Tangosol.Resources/s4hc-cache-config-ssl-non-win.xml";
}

var ccf = new DefaultConfigurableCacheFactory(configFileName);
CacheFactory.ConfigurableCacheFactory = ccf;
}

[TearDown]
public void TearDown()
{
CacheFactory.Shutdown();
}

[Test]
public virtual void TestNamedCache()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
/*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates.
* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
* https://oss.oracle.com/licenses/upl.
*/
using System;
using System.Runtime.InteropServices;
using System.IO;

using NUnit.Framework;
using Tangosol.Net.Cache;
using Tangosol.Net.Messaging.Impl.NamedCache;
using Tangosol.Util;

namespace Tangosol.Net.Impl
{
Expand All @@ -22,6 +20,25 @@ protected override String TestCacheName
get { return "tls12CacheName"; }
}

[SetUp]
public void SetUp()
{
var configFileName = "assembly://Coherence.Tests/Tangosol.Resources/s4hc-cache-config-ssl.xml";
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
configFileName = "assembly://Coherence.Tests/Tangosol.Resources/s4hc-cache-config-ssl-non-win.xml";
}

var ccf = new DefaultConfigurableCacheFactory(configFileName);
CacheFactory.ConfigurableCacheFactory = ccf;
}

[TearDown]
public void TearDown()
{
CacheFactory.Shutdown();
}

[Test]
public virtual void TestNamedCache()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (c) 2024, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* https://oss.oracle.com/licenses/upl.
*/
using System;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Text;

namespace Tangosol.Net.Ssl
{
public sealed class CertificateValidatorNonWindows
{
public CertificateValidatorNonWindows()
{
}

/// <summary>
/// Verifies the remote Secure Sockets Layer (SSL) certificate used for authentication. This callback
/// ignores the content of the Common Name for the certificate during the validation.
/// </summary>
/// <param name="sender">An object that contains state information for this validation.</param>
/// <param name="certificate">The certificate used to authenticate the remote party.</param>
/// <param name="chain">The chain of certificate authorities associated with the remote certificate.</param>
/// <param name="errors">One or more errors associated with the remote certificate.</param>
/// <returns>A Boolean value that determines whether the specified certificate is accepted for authentication.</returns>
public static bool IgnoreCommonNameCertificateValidation(object sender, X509Certificate certificate,
X509Chain chain, SslPolicyErrors errors)
{
return true;

}
}
}
Loading

0 comments on commit 984c49c

Please sign in to comment.