Jump to content


Trust issue connecting to SSL server for the first time

P4Connect P4API.NET

  • Please log in to reply
1 reply to this topic

#1 samwise

samwise

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 23 July 2015 - 01:05 AM

Hi,

I've been debugging through the P4Connect source because it's a good example of using the P4API.NET library. I've had an issue in my own code trying to get trust to be established with a new SSL connection so I thought I'd see what P4Connect does. It has the same issues though. I'm using the latest bleeding edge P4Connect from the Workshop.

When I try to connect to an SSL server that has no trust currently established, I get "failed to connect" in the settings window. When I step through I can see it calls P4Connect.VerifySettings.CheckProjectRoot. In there, when it calls Connection.Connect, it throws a P4Exception with the message about "authenticity can't be established" etc. However I see that there is a call to Connection.Trust AFTER the Connect call.

I want to be able to programmatically accept the trust. What's the right way to do this? You can't call Connection.Trust before connecting, but connect requires trust.

Thanks,
Sam

#2 samwise

samwise

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 23 July 2015 - 06:07 AM

It seems to me that Connection.Trust should be called BEFORE the call to Connect. However, if you try to do this, in Connection.Trust when it tries to construct a new P4Command, the P4Command constructor throws an exception because there is no valid P4Server instance. The P4Server instance is created in Connect and TrustAndConnect, but not when calling Trust on its own.

Also TrustAndConnect fails because of another bug (see my other recent post with the linked job bug report).





Also tagged with one or more of these keywords: P4Connect, P4API.NET

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users