Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

all commands are not working #55

Closed
thebest07111 opened this issue Jun 24, 2020 · 6 comments
Closed

all commands are not working #55

thebest07111 opened this issue Jun 24, 2020 · 6 comments
Labels
Config-error Issue was caused by config error or invalid certificate etc.. Have a workaround Issue have workaround help wanted

Comments

@thebest07111
Copy link

I have for example this powershell script:

$apikey = "apikey here"
@url = "https://snipeit.edsn.local/"

New-User -firstName "klaas" -lastName "Chris" -userName "kchris" -password "whatever" -ldap_user 0 -jobTitle "manager" -email "test@test.com" -url $url -apiKey $apikey

When I run the command i am not getting any feedback but also not the user

@thebest07111
Copy link
Author

I mean $url instead of @url

@snazy2000
Copy link
Owner

Does Get-Asset work?

@thebest07111
Copy link
Author

yes that does seem to work

@thebest07111
Copy link
Author

It seems that when I do https with a self signed certificate it doesnt work.

@dilpatel45
Copy link

@thebest07111 I had that issue aswell. This is what I added in my script to allow self signed certificates

if (-not("dummy" -as [type])) {
add-type -TypeDefinition @"
using System;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;

public static class Dummy {
    public static bool ReturnTrue(object sender,
        X509Certificate certificate,
        X509Chain chain,
        SslPolicyErrors sslPolicyErrors) { return true; }
    public static RemoteCertificateValidationCallback GetDelegate() {
        return new RemoteCertificateValidationCallback(Dummy.ReturnTrue);
    }
}
"@
}

[System.Net.ServicePointManager]::ServerCertificateValidationCallback = [dummy]::GetDelegate()

@PetriAsi
Copy link
Collaborator

Other workaround could be importing servers self signed certificate to trusted certificate store on local computer.

As this was issue with self signed certificates, I'll close this now. Please reopen new issue if needed.

@PetriAsi PetriAsi added Have a workaround Issue have workaround Config-error Issue was caused by config error or invalid certificate etc.. labels May 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Config-error Issue was caused by config error or invalid certificate etc.. Have a workaround Issue have workaround help wanted
Projects
None yet
Development

No branches or pull requests

4 participants