unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: ng0 <ngillmann@runbox.com>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: myglc2 <myglc2@gmail.com>, help-guix@gnu.org
Subject: Re: curl_ca_bundle, and gnurl?
Date: Sat, 01 Oct 2016 11:41:14 +0000	[thread overview]
Message-ID: <87mvio70v9.fsf@we.make.ritual.n0.is> (raw)
In-Reply-To: <87h98xry8u.fsf@elephly.net>

Hi,

Ricardo Wurmus <rekado@elephly.net> writes:

> ng0 <ngillmann@runbox.com> writes:
>
>> Ricardo Wurmus <rekado@elephly.net> writes:
>>
>>> myglc2 <myglc2@gmail.com> writes:
>>>
>>>> With GuixSD user config ...
>> ……
>>>>  )
>>>
>>> You forgot to actually add “nss-certs” to the manifest.  After adding
>>> “nss-certs” you need to set the environment variable CURL_CA_BUNDLE:
>>>
>>>   export CURL_CA_BUNDLE=/home/rekado/.myglc2-profile/etc/ssl/certs/ca-certificates.crt
>>>
>>> (I only recently patched r-curl to respect this environment variable.
>>> We should patch libcurl so that all packages using libcurl understand
>>> it.)
>>>
>>
>> I wonder if we need this for gnurl or if the code base of gnurl is still
>> curl-like enough that it respects the variable.. last time I tried gnurl
>> as a user on its own (which is *not* the intended use) was on Gentoo.
>> Gnurl is afaik not (yet) a gnu project and requires no sync with the gnu
>> descriptions.. I should add this to the description.
>
> Looking at the sources and searching for “getenv” I see this:

Thanks for your reply. I'll see that I address the issue in the next
version release of gnurl. Prior to using GuixSD I wasn't aware of this,
and I do my test builds of gnurl on guixsd and gentoo to assure that
there's no mistake from either systems side.

> …
> gnurl-7_50_3/src/tool_operate.c:    env = curlx_getenv("CURL_CA_BUNDLE");
> gnurl-7_50_3/src/tool_operate.c:      env = curlx_getenv("SSL_CERT_DIR");
> gnurl-7_50_3/src/tool_operate.c:        env = curlx_getenv("SSL_CERT_FILE");
> gnurl-7_50_3/gnurl--/src/tool_operate.c:    env = curlx_getenv("CURL_CA_BUNDLE");
> gnurl-7_50_3/gnurl--/src/tool_operate.c:      env = curlx_getenv("SSL_CERT_DIR");
> gnurl-7_50_3/gnurl--/src/tool_operate.c:        env = curlx_getenv("SSL_CERT_FILE");
> gnurl-7_50_3/gnurl--/lib/Makefile.netware:	@echo $(DL)#define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE")$(DL) >> $@
> gnurl-7_50_3/gnurl--/lib/curl_setup.h:#define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE")
> gnurl-7_50_3/gnurl--/lib/vtls/nss.c:  cert_dir = getenv("SSL_DIR");
> gnurl-7_50_3/gnurl--/lib/config-dos.h:#define CURL_CA_BUNDLE  getenv("CURL_CA_BUNDLE")
> gnurl-7_50_3/lib/Makefile.netware:	@echo $(DL)#define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE")$(DL) >> $@
> …
>
> It looks like these common environment variables are indeed used for the
> tool.  For the library it seems that the environment variable is only
> respected when “config-dos.h” is used.  In other cases it’s a fixed file
> path:
>
> gnurl-7_50_3/src/Makefile:CURL_CA_BUNDLE = "/etc/ssl/certs/ca-certificates.crt"
>
> So gnurl should also be patched to replace the definition of
> CURL_CA_BUNDLE with “getenv("CURL_CA_BUNDLE")”.
>
>> But can you share some insights why curl requires this? For gnurl I rely
>> on its test suite, but I think curl does not complain about the missing
>> CURL_CA_BUNDLE in its test suite either, or does it?
>
> libcurl expects the user to configure the location of the bundle.  If
> this does not happen it defaults to some hardcoded file path.  The
> command line tool uses libcurl and overrides the value when the
> environment variable CURL_CA_BUNDLE is set.
>
> On Guix we cannot guarantee the existence of the hardcoded default path.
> The bundle is not part of the curl package and we cannot presume to know
> where the bundle file will be stored.  For per-profile certificates (a
> user might want to distrust certain certificates, while another might
> want to use the defaults) we should not hardcode this but defer the
> decision to the CURL_CA_BUNDLE environment variable.
>
>> And if gnurl should require this, how could I fix gnurl (not the package
>> description in guix) to drop this strange behavior if it is possible at
>> all?
>
> It would be the same patch: we need to define CURL_CA_BUNDLE to be
> “getenv("CURL_CA_BUNDLE)” instead of a fixed path.
>
> ~~ Ricardo
>
>

-- 

      reply	other threads:[~2016-10-01 11:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-29 23:09 R install.packages() fails: 'Peer certificate cannot be authenticated with given CA certificates' myglc2
2016-09-30  7:08 ` Ricardo Wurmus
2016-09-30 14:12   ` curl_ca_bundle, and gnurl? ng0
2016-09-30 19:20     ` Ricardo Wurmus
2016-10-01 11:41       ` ng0 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mvio70v9.fsf@we.make.ritual.n0.is \
    --to=ngillmann@runbox.com \
    --cc=help-guix@gnu.org \
    --cc=myglc2@gmail.com \
    --cc=rekado@elephly.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).