Azure / hpcpack

The repo to track public issues for Microsoft HPC Pack product.
MIT License
30 stars 12 forks source link

SchedulerConnect failure on 6.3.8187-beta #46

Open weshinsley opened 4 months ago

weshinsley commented 4 months ago

Problem Description

My .net code that works with 6.3.8025-beta fails using 6.3.8187-beta when I call Scheduler.connect()

Steps to Reproduce

Call Scheduler.Connect with the 6.3.8187-beta installed, and the failure happens. Revert back to 6.3.8025-beta, and I get working behaviour again.

Expected Results

Return scheduler object

Actual Results

HttpRequestException: The SSL connection could not be established, see inner exception. AuthenticationException: The remote certificate was rejected by the provided RemoteCertificateValidationCallback.

Additional Comments

Our headnode is on Win Server 2019, running HPC Pack 2019 - 6.1.7531.0 (I haven't been able to schedule downtime to upgrade to update 2 yet - could this be the problem?)

YutongSun commented 4 months ago

@weshinsley, this is because the certificate validation is enabled in 8187. You may save the following in hpc.reg file and double click the file to import the registry to bypass CN check on the Windows client machines. Set the value to 0 to bypass both CN and CA checks.

Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HPC] "CertificateValidationType"=dword:00000001

For Linux client machines, you may set CertificateValidationType in /etc/hpcpack/config.json file, or set the environment variable CCP_CONFIG_CertificateValidationType.

JDA88 commented 4 months ago

Is there a way to pass CertificateValidationType.BypassCnValidation to Scheduler.ConnectAsync / Scheduler.Connect ? Editing local Computer Registry is not alway possible

YutongSun commented 3 months ago

@JDA88 , yes, we can add the environment variable support for the registry configurations on Windows as well. So you may set the environment e.g. CCP_CONFIG_CertificateValidationType=0 to bypass the cert validation. Would that work for you?

JDA88 commented 3 months ago

This will work perfectly yes!