[SOLVED]certbot and certbot-auto mga6

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

[SOLVED]certbot and certbot-auto mga6

Postby pernel » Nov 8th, '18, 12:30

I would like to use certbot or certbot-auto to setup automatic generation of authority signed certificates. A package for certbot exists in the distro. I tested the command
Code: Select all
certbot -d xyz.se --apache
giving the following output:
Code: Select all
Traceback (most recent call last):
  File "/usr/bin/certbot", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3140, in <module>
    @_call_aside
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3126, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 3153, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 640, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 941, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 828, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pyasn1' distribution was not found and is required by requests

Is there any way to make cerbot recognise the distribution correcltly?

certbot-auto gives the following output:
Code: Select all
[root@lindell ~]# certbot-auto
Upgrading certbot-auto 0.27.1 to 0.28.0...
Replacing certbot-auto...
Creating virtual environment...
Installing Python packages...
Installation succeeded.
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Certbot doesn't know how to automatically configure the web server on this system. However, it can still get a certificate for you. Please run "certbot-auto certonly" to do so. You'll need to manually configure your web server to use the resulting certificate.
[root@lindell ~]#

"certbot-auto certonly" is not a good option since the generated certificate is valid only 3 months and requires manual configuration.
Is there any way I can make certbot-auto work with mga 6 and apache?
Last edited by pernel on Apr 5th, '20, 11:17, edited 1 time in total.
pernel
 
Posts: 57
Joined: Mar 21st, '12, 20:13

Re: certbot and certbot-auto mga6

Postby doktor5000 » Nov 8th, '18, 20:15

FWIW, you may want to follow https://bugs.mageia.org/show_bug.cgi?id=22636 for a similar issue, although in your case a different library seems to be missing.
Try installing python-pyasn1 or python3-pyasn1 and then try again.

For some working alternatives, check e.g. https://bugs.mageia.org/show_bug.cgi?id=17021
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17629
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: certbot and certbot-auto mga6

Postby pernel » Nov 9th, '18, 17:53

Had already python-pyasn1 before but after installation of python3-pyasn1 the error message:
Code: Select all
[root@lindell ~]# certbot -d xyz.se --apache
Saving debug log to /var/log/letsencrypt/letsencrypt.log
The apache plugin is not working; there may be problems with your existing configuration.
The error was: PluginError('There has been an error in parsing the file /etc/httpd/conf/conf.d/security.conf on line 17: Syntax error',)
[root@lindell ~]#

is much more short and points to an error in "/etc/httpd/conf/conf.d/security.conf.
The output of letsencrypt-log is:
Code: Select all
2018-11-09 16:40:54,183:DEBUG:certbot.main:certbot version: 0.20.0
2018-11-09 16:40:54,184:DEBUG:certbot.main:Arguments: ['-d', 'xyz.se', '--apache']
2018-11-09 16:40:54,185:DEBUG:certbot.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#apache,PluginEntryPoint#manual,PluginEntryPoint#nginx,PluginEntryPoint#null,PluginEntryPoint#standalone,PluginEntryPoint#webroot)
2018-11-09 16:40:54,206:DEBUG:certbot.log:Root logging level set at 20
2018-11-09 16:40:54,207:INFO:certbot.log:Saving debug log to /var/log/letsencrypt/letsencrypt.log
2018-11-09 16:40:54,208:DEBUG:certbot.plugins.selection:Requested authenticator apache and installer apache
2018-11-09 16:40:54,374:DEBUG:certbot_apache.configurator:Apache version is 2.4.27
2018-11-09 16:40:54,727:DEBUG:certbot.plugins.disco:Other error:(PluginEntryPoint#apache): There has been an error in parsing the file /etc/httpd/conf/conf.d/security.conf on line 17: Syntax error
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/certbot/plugins/disco.py", line 130, in prepare
    self._initialized.prepare()
  File "/usr/lib/python3.5/site-packages/certbot_apache/configurator.py", line 227, in prepare
    self.check_parsing_errors("httpd.aug")
  File "/usr/lib/python3.5/site-packages/certbot_apache/augeas_configurator.py", line 77, in check_parsing_errors
    raise errors.PluginError(msg)
certbot.errors.PluginError: There has been an error in parsing the file /etc/httpd/conf/conf.d/security.conf on line 17: Syntax error
2018-11-09 16:40:54,728:DEBUG:certbot.plugins.selection:No candidate plugin
2018-11-09 16:40:54,728:DEBUG:certbot.plugins.selection:Selected authenticator None and installer None


In https://bugs.mageia.org/show_bug.cgi?id=22636 they mention two missing double quotes in the file "/etc/httpd/conf/conf.d/security.conf". Unfortunately I can not understand exactly where in this file.
Any clue to this?
pernel
 
Posts: 57
Joined: Mar 21st, '12, 20:13

Re: certbot and certbot-auto mga6

Postby doktor5000 » Nov 10th, '18, 16:43

pernel wrote:In https://bugs.mageia.org/show_bug.cgi?id=22636 they mention two missing double quotes in the file "/etc/httpd/conf/conf.d/security.conf". Unfortunately I can not understand exactly where in this file.
Any clue to this?


Well, I would guess there's at least an issue about parsing line 17, so it might help to post it here ...
pernel wrote:The error was: PluginError('There has been an error in parsing the file /etc/httpd/conf/conf.d/security.conf on line 17: Syntax error',)
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17629
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: certbot and certbot-auto mga6

Postby pernel » Apr 5th, '20, 11:17

After installing endless of python2.7 packages and updated with "pip" finally certbot-auto --renew worked in the end of 2019. Unfortunately I can't tell exactly which packages was lacking.
pernel
 
Posts: 57
Joined: Mar 21st, '12, 20:13


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest

cron