Scope-IT / marksman

Windows agent for Snipe-IT asset management system
Apache License 2.0
129 stars 23 forks source link

Please double-check the BaseURI key in your <appSettings> #20

Closed GoldBond007 closed 5 years ago

GoldBond007 commented 5 years ago

Hey Guys,

When I run the Marksman.exe file I get the "Please double-check the BaseURI key in your " error. I have already edited the config file to match my baseURI and API key as indicated in the README. Any suggestions on how to get this fixed? Thanks!

Below is the output when I run the Exe and my Config file

6/17/2019 4:35:32 PM: Started application. System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure. at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult) at System.Net.TlsStream.CallProcessAuthentication(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result) at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size) at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size) at System.Net.ConnectStream.WriteHeaders(Boolean async) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.GetResponse() at Marksman.Broker.CheckConnection(NameValueCollection appSettings) Please double-check the BaseURI key in your block of the Marksman config file and ensure it points to your instance of Snipe-IT. ERROR: Could not connect to SnipeIT database instance.

config file: <?xml version="1.0" encoding="utf-8" ?>

danielhogg commented 5 years ago

A few questions: 1) Is your SnipeIT instance set up to work over HTTP or HTTPS? 2) What is the prefix of your BaseURI in your config file? (I.e. http or https) 3) Is your HTTPS certificate for your snipeIT instance valid?

Based on the stack trace, this looks like a HTTPS/SSL issue.

GoldBond007 commented 5 years ago

I appreciate your quick reply danielhogg:

1) SnipeIT is set up to work over HTTPS 2) https 3) HTTPS is probably not valid for the my SNIPE IT instance. What do I need to do in order to make it valid?

danielhogg commented 5 years ago

As for setting up HTTPS certificates, personally I use Let's Encrypt, but it may not be suitable for your purposes.

First let's make sure that the certificate is actually the problem. If you go in chrome and visit your SnipeIT instance, click on the lock icon to the left of the URL. What does it say there about your certificate?

GoldBond007 commented 5 years ago

It's a certificate issue, see the attached screenshot: image

GoldBond007 commented 5 years ago

Since I don't really need HTTPS for this environment, as the server SNIPE IT is connected doesn't go out to the internet, I am trying to turn off HTTPS and just access it via port 80. Please let me know the simplest method to disabling HTTPS.

GoldBond007 commented 5 years ago

I was able to turn HTTPS off on my server. It works flawlessly through HTTP.

danielhogg commented 5 years ago

Great! I am glad to hear that the issue is resolved. @velaar had recommended setting it up for HTTP as you have done, since your server is local.

brunotvaz commented 3 years ago

Hi Guys,

1st let me CONGRATULATE all of you for your hard work and dedication to this project. THANK YOU !! In relation to this particular issue: "Could not establish trust relationship for the SSL/TLS secure channel" Is it possible to "allow" self-signed certificates or somehow bypass the "ssl check" ? Maybe this will help ???! https://dejanstojanovic.net/aspnet/2014/september/bypass-ssl-certificate-validation/ Bypass SSL certificate validation Many thanks in advance.