Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Certificate error on Ubuntu 18 #20

Open
Chris-Carmichael opened this issue Apr 2, 2019 · 1 comment
Open

Certificate error on Ubuntu 18 #20

Chris-Carmichael opened this issue Apr 2, 2019 · 1 comment

Comments

@Chris-Carmichael
Copy link

Getting this error when attempting to connect:

PS /home/chris> Connect-AnsibleTower -Credential $tower -TowerUrl 'https://ansible.oxya.com' -DisableCertificateVerification
add-type : (4,37): error CS0246: The type or namespace name 'ICertificatePolicy' could not be found (are you missing a using directive or an assembly reference?)
    public class NoSSLCheckPolicy : ICertificatePolicy {
                                    ^
At /home/chris/.local/share/powershell/Modules/AnsibleTower/0.1/AnsibleTower.psm1:145 char:9
+         add-type @"
+         ~~~~~~~~~~~
+ CategoryInfo          : InvalidData: ((4,37): error C...bly reference?):CSDiagnostic) [Add-Type], Exception
+ FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand

add-type : Cannot add type. Compilation errors occurred.
At /home/chris/.local/share/powershell/Modules/AnsibleTower/0.1/AnsibleTower.psm1:145 char:9
+         add-type @"
+         ~~~~~~~~~~~
+ CategoryInfo          : InvalidData: (:) [Add-Type], InvalidOperationException
+ FullyQualifiedErrorId : COMPILER_ERRORS,Microsoft.PowerShell.Commands.AddTypeCommand

new-object : Cannot find type [NoSSLCheckPolicy]: verify that the assembly containing this type is loaded.
At /home/chris/.local/share/powershell/Modules/AnsibleTower/0.1/AnsibleTower.psm1:158 char:63
+ ... ServicePointManager]::CertificatePolicy = new-object NoSSLCheckPolicy
+                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidType: (:) [New-Object], PSArgumentException
+ FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand

That didn't work at all
At /home/chris/.local/share/powershell/Modules/AnsibleTower/0.1/AnsibleTower.psm1:180 char:8
+        Throw "That didn't work at all"
+        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : OperationStopped: (That didn't work at all:String) [], RuntimeException
+ FullyQualifiedErrorId : That didn't work at all

PS /home/chris>

Ubuntu infos:

chris@DERVISH:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic
chris@DERVISH:~$
@Chris-Carmichael
Copy link
Author

BTW, this is a Powershell Core thing. I've started migrating all my stuff to Core and this is one of the things that's still broken.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant