From owner-freebsd-pkg@FreeBSD.ORG Mon Jan 19 13:02:48 2015 Return-Path: Delivered-To: pkg@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06EE2AA7 for ; Mon, 19 Jan 2015 13:02:48 +0000 (UTC) Received: from mail-wi0-x22f.google.com (mail-wi0-x22f.google.com [IPv6:2a00:1450:400c:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 880779D3 for ; Mon, 19 Jan 2015 13:02:47 +0000 (UTC) Received: by mail-wi0-f175.google.com with SMTP id fb4so8980540wid.2 for ; Mon, 19 Jan 2015 05:02:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:mime-version:date:content-type:content-transfer-encoding :message-id:from:subject:to:in-reply-to:references; bh=+1kmhPyaqSNoynzhTzf2wiEQEJIVTuvqd2845qD9W9s=; b=I/v2vILjJ3RWZVSSG1hWONvYPQ3wQQySpYjZTvYa2xKAK5OmmVUaw03KJkV0s/EQxf xgjk5Q/RpJrzMJfj+0Xexg/+b7lvY/1KtMFUwCO3kb7nQEqtN5p3IHHQRW1F1P9RdKaD /zhd64fJc4fGGrp/SHVeZ1NDf4ROxtnBPfxP8mbxrOlEMOPsaTS7OA7KgWFXAowDeBks lFA+Rxo3t6yWNK3j7IuiyPm7V1NhAwKpeBr0+87hu5I7WAY5VBdYmdG1X8OeUaA9XnKF a59ELKoj28wNPwo0/PaOFXZLs5NoJ4ikSm1zHQmAz90te31QasrHSkGaDXZHvH7+uj41 x61w== X-Received: by 10.195.12.15 with SMTP id em15mr60783614wjd.80.1421672565954; Mon, 19 Jan 2015 05:02:45 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id fc6sm14128381wib.12.2015.01.19.05.02.44 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Jan 2015 05:02:45 -0800 (PST) Sender: Baptiste Daroussin Received: from mail.etoilebsd.net (localhost [IPv6:::1]); by ivaldir.etoilebsd.net (OpenSMTPD) with ESMTP id f473e663; Mon, 19 Jan 2015 14:02:44 +0100 (CET) Mime-Version: 1.0 Date: Mon, 19 Jan 2015 13:02:44 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <76584af2ed2d6623840009646a6df861@mail.etoilebsd.net> X-Mailer: RainLoop/1.7.2.220 From: "Baptiste Daroussin" Subject: Re: Please help regarding usage of client certifcates with pkg command used on freeBSD To: "Mohit Hasija" , pkg@freebsd.org In-Reply-To: <005efbaf6e8a4d6fa6800a5e25383d26@NODEXCHMBX003.TechMahindra.com> References: <005efbaf6e8a4d6fa6800a5e25383d26@NODEXCHMBX003.TechMahindra.com> , <9ad51442a3c72408e067ef1d1af8ee6e@mail.etoilebsd.net> X-BeenThere: freebsd-pkg@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Binary package management and package tools discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2015 13:02:48 -0000 January 19 2015 1:58 PM, "Mohit Hasija" wro= te: =0A> Dear Baptiste,=0A> =0A> we have found from the pkg source code t= hat the environment variables SSL_CLIENT_CERT_FILE and=0A> SSL_CLIENT_KEY= _FILE are required to be set before using client certificates with pkg.= =0A> =0A> In order to automate the setting of environment variables, befo= re pkg begins https authentication=0A> with a remote repository server, w= e decided to use plugins feature of pkg.We decided to write a=0A> callbac= k function that would be called at appropriate time and set the environme= nt variables.=0A> However, after much R&D, we could not find any HOOK tha= t could be used to register a callback=0A> function, which could be calle= d before https authentication takes place.=0A> =0A> Hence, we have decide= d to use pkg_plugin_init() function for setting the environment variables= .This=0A> function is called every time a pkg command is executed and hen= ce we can set the environment=0A> variables.In pkg_plugin_shutdown() func= tion, we can remove the environment variables.=0A> =0A> Please suggest an= y better method to set the environment variables or provide your feedback= on our=0A> approach.=0A> =0A=0APKG_ENV in pkg.conf is exactly designed f= or that=0A=0ABest regards,=0ABapt