Skip to content

Certificate error on Ubuntu 18 #20

Description

@Chris-Carmichael

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:~$

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions