title: How to avoid a Conan SSL user authentication error with Jenkins Artifactory plugin?
body: <p>My company is new to Conan, Artifactory, and Jenkins, but we set up some test pipeline scripts a few months ago and utilized the Jenkins Artifactory plugin to publish some Conan packages to our Artifactory server.  These scripts are now failing with an SSL certification failure.</p>
  
  <p>We are using the following packages:</p>
  
  <ul>
  <li>Jenkins v2.121</li>
  <li>Jenkins Artifactory Plugin v2.16.1</li>
  <li>Artifactory Pro v5.10.3</li>
  <li>Conan v1.3.3</li>
  </ul>
  
  <p>Our "package and publish" stage in our pipline scripts look similar to this when it comes to Artifactory configuration:</p>
  
  <pre><code>stage('Package and Publish') {
      def artifactory_name = "MyCompanyArtifactory"
      def artifactory_repo = "conan-local"
  
      def server = Artifactory.server artifactory_name
      def client = Artifactory.newConanClient()
      def serverName = client.remote.add server: server, repo: artifactory_repo
  
      client.run(command: "export-pkg . ci-user/stable -s os=Linux -s arch=x86_64 -s build_type=Debug")
      client.run(command: "export-pkg . ci-user/stable -s os=Linux -s arch=x86_64 -s build_type=Release")
      String myCmd = "upload MyLib/* --all -r ${serverName} --confirm"
      def bInfo = client.run(command: myCmd)
      //server.publishBuildInfo bInfo
  }
  </code></pre>
  
  <p>This code was working at one time, but I believe it stopped working when our IT department switched Artifactory over to HTTPS access.  Now, Jenkins errors out when attempting to set the Conan user for our repo:</p>
  
  <pre><code>[Pipeline] // stage
  [Pipeline] stage
  [Pipeline] { (Package and Publish)
  [Pipeline] getArtifactoryServer
  [Pipeline] initConanClient
  [shared-mylib] $ sh -c 'conan config set log.trace_file=\"/home/builduser/jenkins/workspace/shared-mylib@tmp/conan.tmp261537390058591873/conan_log.log\" '
  [Pipeline] conanAddRemote
  [shared-mylib] $ sh -c "conan remote add b519966f-f612-4094-b3ea-453a017cf793 https://artifactory.mycompany.com/artifactory/api/conan/conan-local "
  WARN: Remotes registry file missing, creating default one in /home/builduser/jenkins/workspace/shared-rtplib@tmp/conan.tmp261537390058591873/.conan/registry.txt
  [Pipeline] conanAddUser
  Adding conan user 'ci-user', server 'b519966f-f612-4094-b3ea-453a017cf793'
  [shared-mylib] $ sh -c ********
  ERROR: HTTPSConnectionPool(host='artifactory.mycompany.com', port=443): Max retries exceeded with url: /artifactory/api/conan/conan-local/v1/users/authenticate (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)'),))
  </code></pre>
  
  <p>This behavior is not limited to Jenkins access; it is also happening when regular users attempt to access the Artifactory Conan repo, but we can get around it by adding the remote repo with Verify_SSL as False (at the end of the following command):</p>
  
  <pre><code>conan remote add myco-conan-local https://artifactory.mycompany.com/artifactory/api/conan/conan-local False
  </code></pre>
  
  <p>I believe the <a href="https://docs.conan.io/en/latest/howtos/use_tls_certificates.html" rel="noreferrer" title="Conan">Conan</a> documentation indicates we have two options:</p>
  
  <ul>
  <li>Disable the SSL verification via a <code>conan remote</code> command (above)</li>
  <li>Append the server crt file to the cacert.pem file in the conan home directory.</li>
  </ul>
  
  <p>Unfortunately I haven't been able to figure out how to accomplish either solution when it comes to the Jenkins pipeline script.  So my questions:</p>
  
  <ol>
  <li><strong>Is there a way to disable SSL verification with the <code>client.remote.add</code> command (or something similar) in the Jenkins pipeline script?</strong></li>
  <li><strong>Is there a way to include the necessary server certificate via the Jenkins pipeline script (so that it gets added to the workspace-specific conan home directory automatically)?</strong></li>
  </ol>
  
  <p>Option #1 is probably preferred for a simpler short-term solution, but I'd like to understand how Option #2 is accomplished as well.  </p>
  
  <p>Thanks for reading.</p>