Re: How to use macros in acme-client.conf?

2021-07-26 Thread Michael Hekeler
Am 25.07.21 18:54 schrieb Wolf:
> (...)
> api_url="https://acme-v02.api.letsencrypt.org/directory";
> authority letsencrypt {
>   api url $api_url
>   account key "/etc/acme/letsencrypt-privkey.pem"
> }

please check if you accidently inserted some control characters when
copy&paste the snippet from the manpage to test.conf.

To test you can remove all whitespace before the word "api" and after
"$api_url".
 

> It fails with a syntax error:
> 
> $ ./acme-client -vvv -f ../test.conf
> api_url = "https://acme-v02.api.letsencrypt.org/directory";
> ../test.conf:3: syntax error

What is "-vvv"? 
Manpage on my 6.9-STABLE mentions "Specify twice..."


> It looks like the macro is loaded correctly, but the expansion fail. Are
> the macros just bugged? If not, could someone please advice me on what I
> am doing wrong?
>

macro expansion works on all of my systems.
So they are not "just bugged" ;-)



Re: How to use macros in acme-client.conf?

2021-07-26 Thread Edgar Pettijohn



On 7/26/21 5:20 AM, Omar Polo wrote:

Alexis  writes:


Stuart Henderson  writes:


In gmane.os.openbsd.misc, you wrote:

I'm trying to use macros in my acme-client.conf, but it seems I
cannot
get the syntax right. In addition to that, even when I try the
example
from the acme-client.conf(5):

api_url="https://acme-v02.api.letsencrypt.org/directory";
authority letsencrypt {
api url $api_url
account key "/etc/acme/letsencrypt-privkey.pem"
}

It fails with a syntax error:

$ ./acme-client -vvv -f ../test.conf
api_url = "https://acme-v02.api.letsencrypt.org/directory";
../test.conf:3: syntax error

Are spaces around the '=' permitted? i thought they weren't. The
example in acme-client.conf(5) man page certainly doesn't have them.

The parser.y used in acme-client (and other stuff in base) is quite
flexible w.r.t. spaces/tabs

 602 top:
 603 p = buf;
 604 while ((c = lgetc(0)) == ' ' || c == '\t')
 605 ; /* nothing */

In sh (and probably other languages) spaces around the equal sign aren't
permitted (well, the are valid but yields a different result).


Alexis.


Might be worth checking for non printable characters:

#!/usr/bin/env perl
#
# set tabstop=2
#
use common::sense;

my $file = shift or die "usage: $0 filename\n";

open my $fh, "<", $file or die "$!";

my $line_number = 1;
while (<$fh>) {
    my @chars = split //;
    for (@chars) {
        my $ord = ord $_;
        # skip newlines and tabs
        next if ($ord == 10 || $ord == 9);
        die "non printable character found: $line_number: $ord\n"
            if ($ord < 32 || $ord > 126);
    }
    $line_number++;
}

close $fh;

1;




Re: How to use macros in acme-client.conf?

2021-07-26 Thread Omar Polo


Alexis  writes:

> Stuart Henderson  writes:
>
>> In gmane.os.openbsd.misc, you wrote:
>>> I'm trying to use macros in my acme-client.conf, but it seems I
>>> cannot
>>> get the syntax right. In addition to that, even when I try the
>>> example
>>> from the acme-client.conf(5):
>>>
>>> api_url="https://acme-v02.api.letsencrypt.org/directory";
>>> authority letsencrypt {
>>> api url $api_url
>>> account key "/etc/acme/letsencrypt-privkey.pem"
>>> }
>>>
>>> It fails with a syntax error:
>>>
>>> $ ./acme-client -vvv -f ../test.conf
>>> api_url = "https://acme-v02.api.letsencrypt.org/directory";
>>> ../test.conf:3: syntax error
>
> Are spaces around the '=' permitted? i thought they weren't. The
> example in acme-client.conf(5) man page certainly doesn't have them.

The parser.y used in acme-client (and other stuff in base) is quite
flexible w.r.t. spaces/tabs

602 top:
603 p = buf;
604 while ((c = lgetc(0)) == ' ' || c == '\t')
605 ; /* nothing */

In sh (and probably other languages) spaces around the equal sign aren't
permitted (well, the are valid but yields a different result).

> Alexis.



Re: How to use macros in acme-client.conf?

2021-07-26 Thread Alexis



Stuart Henderson  writes:


In gmane.os.openbsd.misc, you wrote:
I'm trying to use macros in my acme-client.conf, but it seems I 
cannot
get the syntax right. In addition to that, even when I try the 
example

from the acme-client.conf(5):

api_url="https://acme-v02.api.letsencrypt.org/directory";
authority letsencrypt {
api url $api_url
account key "/etc/acme/letsencrypt-privkey.pem"
}

It fails with a syntax error:

$ ./acme-client -vvv -f ../test.conf
api_url = "https://acme-v02.api.letsencrypt.org/directory";
../test.conf:3: syntax error


Are spaces around the '=' permitted? i thought they weren't. The 
example in acme-client.conf(5) man page certainly doesn't have 
them.



Alexis.



Re: How to use macros in acme-client.conf?

2021-07-26 Thread Stuart Henderson
In gmane.os.openbsd.misc, you wrote:
> I'm trying to use macros in my acme-client.conf, but it seems I cannot
> get the syntax right. In addition to that, even when I try the example
> from the acme-client.conf(5):
>
> api_url="https://acme-v02.api.letsencrypt.org/directory";
> authority letsencrypt {
>   api url $api_url
>   account key "/etc/acme/letsencrypt-privkey.pem"
> }
>
> It fails with a syntax error:
>
> $ ./acme-client -vvv -f ../test.conf
> api_url = "https://acme-v02.api.letsencrypt.org/directory";
> ../test.conf:3: syntax error
>
> It looks like the macro is loaded correctly, but the expansion fail. Are
> the macros just bugged? If not, could someone please advice me on what I
> am doing wrong?

It works for me. Are you using a new manpage with an old version
of acme-client?



How to use macros in acme-client.conf?

2021-07-25 Thread Wolf
Greetings,

I'm trying to use macros in my acme-client.conf, but it seems I cannot
get the syntax right. In addition to that, even when I try the example
from the acme-client.conf(5):

api_url="https://acme-v02.api.letsencrypt.org/directory";
authority letsencrypt {
api url $api_url
account key "/etc/acme/letsencrypt-privkey.pem"
}

It fails with a syntax error:

$ ./acme-client -vvv -f ../test.conf
api_url = "https://acme-v02.api.letsencrypt.org/directory";
../test.conf:3: syntax error

It looks like the macro is loaded correctly, but the expansion fail. Are
the macros just bugged? If not, could someone please advice me on what I
am doing wrong?

Thank you,
W.

PS: I'm not subscribed so please CC.

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.


signature.asc
Description: PGP signature