Hey Community members,
Hoping someone can help with an issue I am having while creating a Content Library Item from a URI.
SgwOvaUrl = "https://d28e23pnuuv0hr.cloudfront.net/aws-storage-gateway-latest.ova"
New-ContentLibraryItem -ContentLibrary $ContentLibParams.ContentLibrary -Name $ContentLibParams.Name -Uri $SgwOvaUrl -FileName "aws-storage-gateway-latest.ova" -DisableOvfCertificateChecks
It seems the DisableOvfCertificateChecks doesn't appear to work.
Output
ErrorRecord : 31/03/2021 11:55:17 New-ContentLibraryItem Error occurred while pulling the file from the remote server. For more details check
the inner exception.
WasThrownFromThrowStatement : False
TargetSite : System.Collections.ObjectModel.Collection`1[System.Management.Automation.PSObject] Invoke(System.Collections.IEnumerable)
StackTrace : at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
at System.Management.Automation.Runspaces.Pipeline.Invoke()
at Microsoft.PowerShell.Executor.ExecuteCommandHelper(Pipeline tempPipeline, Exception& exceptionThrown, ExecutionOptions
options)
Message : The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop:
31/03/2021 11:55:17 New-ContentLibraryItem Error occurred while pulling the file from the remote server. For more details check
the inner exception.
Data : {System.Management.Automation.Interpreter.InterpretedFrameInfo}
InnerException :
HelpLink :
Source : System.Management.Automation
HResult : -2146233087
vSphere Client Error
The import of library item 31f007e1-9a66-4276-ae8e-324a07c5cbcb has failed. Reason: Error transferring file aws-storage-gateway-latest.ova from https://d28e23pnuuv0hr.cloudfront.net/aws-storage-gateway-latest.ova. Reason: Server not trusted: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.
Workaround but would prefer not to use
Invoke-WebRequest -Uri $SgwOvaUrl -OutFile "../../../Downloads/sgw.ova"
New-ContentLibraryItem -ContentLibrary $ContentLibParams.ContentLibrary -Name $ContentLibParams.Name -Files "../../../Downloads/sgw.ova" -DisableOvfCertificateChecks
Hope it's just me and can be easily resolved, thanks.
Did you already try adding the SslThumbPrint parameter on the New-ContentLibraryItem cmdlet?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Did you already try adding the SslThumbPrint parameter on the New-ContentLibraryItem cmdlet?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hey Luc,
Thanks for replying.
I have gone ahead and tested the parameter suggested which appears to at least import the files. I have another issue where it doesn't seem to recognise the Item Type but this is another issue I will have to workaround. The source files could be the cause.
Any ideas on how to pull the SSL thumbprint using Powershell?
William's Get-SSLThumbprint.ps1 does that
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks for your help.