Koozali.org: home of the SME Server

Questions re PHPKI

Offline mauro

  • ***
  • 101
  • +0/-0
Questions re PHPKI
« on: July 31, 2021, 08:42:56 AM »
I'm in the process of upgrading from SME9.2 to 10 and migrating the contribs.

1) What's the difference between phpki and phpki-ng?

2) Installation does not work:
Code: [Select]
yum install --enablerepo=smecontribs,epel smeserver-phpki
Loaded plugins: fastestmirror, post-transaction-actions, priorities, smeserver
Loading mirror speeds from cached hostfile
 * base: ftp.plusline.net
 * epel: ftp-stud.hs-esslingen.de
 * smeaddons: ftp.nluug.nl
 * smecontribs: ftp.nluug.nl
 * smeextras: ftp.nluug.nl
 * smeos: ftp.nluug.nl
 * smeupdates: ftp.nluug.nl
 * updates: ftp.wrz.de
1035 packages excluded due to repository priority protections
No package smeserver-phpki available.
Error: Nothing to do

All parts should go together without forcing. You must remember that the parts you are reassembling were disassembled by you. Therefore, if you can't get them together again, there must be a reason. By all means, do not use a hammer.
-- IBM maintenance manual (1975)

Offline sages

  • *
  • 182
  • +0/-0
    • http://www.sages.com.au
Re: Questions re PHPKI
« Reply #1 on: July 31, 2021, 09:40:53 AM »
Looking here https://wiki.koozali.org/Category:Contrib PHPKi is still in smetest and then looking here https://wiki.koozali.org/PHPki it states that PHPKi is no longer in use and PHPKi-ng is the replacement. And at the bottom of the PHPKi wiki entry is a number of bug links that are worth investigating.
...

Offline ReetP

  • *
  • 3,731
  • +5/-0
Re: Questions re PHPKI
« Reply #2 on: July 31, 2021, 10:08:45 AM »
Use smerserver-phpki-ng - the old version likely won't work at all.

It has updated default security settings and a whole pile of fixes.

It should work, but needs testing. Please help verify any of the existing bugs.

On install when you click to create the CA just click once and be VERY patient as it takes a while to generate it.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline mauro

  • ***
  • 101
  • +0/-0
Re: Questions re PHPKI
« Reply #3 on: July 31, 2021, 10:36:50 AM »
Thanks, I'll go for the new version then.
As I am upgrading from SM9.2 to 10, is there any chance to import the existing certificates into phpki-ng or is it not compatible any more?
All parts should go together without forcing. You must remember that the parts you are reassembling were disassembled by you. Therefore, if you can't get them together again, there must be a reason. By all means, do not use a hammer.
-- IBM maintenance manual (1975)

Offline sages

  • *
  • 182
  • +0/-0
    • http://www.sages.com.au
Re: Questions re PHPKI
« Reply #4 on: July 31, 2021, 11:16:48 AM »
Please read the bug reports and the wiki, your question may have been answered already
...

Offline Jean-Philippe Pialasse

  • *
  • 2,762
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Questions re PHPKI
« Reply #5 on: July 31, 2021, 03:57:41 PM »
you have to start from scratch to upgrade the level of security : keys have to be stronger nowaday and this is the reason you need to be patient for its creation.

Offline ReetP

  • *
  • 3,731
  • +5/-0
Re: Questions re PHPKI
« Reply #6 on: August 01, 2021, 05:49:54 PM »
You could theoretically use them, but I really don't recommend it, and am not going to try and document how to do it.

Use it as an opportunity to create new more secure certs. If you don't do it now you'll keep putting it off and all the while your certs become less secure.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline mauro

  • ***
  • 101
  • +0/-0
Re: Questions re PHPKI
« Reply #7 on: August 02, 2021, 08:48:14 AM »
Actually during the installation it's written clearly on the console to create new certificates, if one pays attention...  :-)

So I created new certificates  from scratch, however I must have done something wrong because every now and then I get from the console:
Code: [Select]
Broadcast message from root@xxxx (Mon 2021-08-02 08:38:01 CEST):

Password entry required for 'Enter Private Key Password:' (PID 3253).
Please enter password with the systemd-tty-ask-password-agent tool!

If I don't enter that password, the openvpn-bridge does not start.
All parts should go together without forcing. You must remember that the parts you are reassembling were disassembled by you. Therefore, if you can't get them together again, there must be a reason. By all means, do not use a hammer.
-- IBM maintenance manual (1975)

Offline ReetP

  • *
  • 3,731
  • +5/-0
Re: Questions re PHPKI
« Reply #8 on: August 02, 2021, 10:32:24 AM »
You set a password for the certificate which you did not need to do.

You can set an 'askpass' variable in openvpn but you then store your password in plain text. So pretty pointless.

Go back and create the cert (not the CA) without a password.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline mauro

  • ***
  • 101
  • +0/-0
Re: Questions re PHPKI
« Reply #9 on: August 02, 2021, 10:43:15 AM »
Thanks
All parts should go together without forcing. You must remember that the parts you are reassembling were disassembled by you. Therefore, if you can't get them together again, there must be a reason. By all means, do not use a hammer.
-- IBM maintenance manual (1975)

Offline mauro

  • ***
  • 101
  • +0/-0
Re: Questions re PHPKI
« Reply #10 on: August 05, 2021, 10:51:55 AM »
I thought I have solved the problem, but on reboot it asked me for the password again.
To be sure I understood correctly, I have now:
- the root certificate with password
- one certificate for openvpn server-side without pass (the old one with password has been revoked)
- more certificates for openvpn clients without pass
All parts should go together without forcing. You must remember that the parts you are reassembling were disassembled by you. Therefore, if you can't get them together again, there must be a reason. By all means, do not use a hammer.
-- IBM maintenance manual (1975)

Offline ReetP

  • *
  • 3,731
  • +5/-0
Re: Questions re PHPKI
« Reply #11 on: August 05, 2021, 01:10:58 PM »
I've patched smeserver-phpki-ng

https://bugs.koozali.org/show_bug.cgi?id=11402

Patched phpki-ng

https://bugs.koozali.org/show_bug.cgi?id=11402

Please test them.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline ReetP

  • *
  • 3,731
  • +5/-0
Re: Questions re PHPKI
« Reply #12 on: August 05, 2021, 01:16:59 PM »
I thought I have solved the problem, but on reboot it asked me for the password again.
To be sure I understood correctly, I have now:
- the root certificate with password
- one certificate for openvpn server-side without pass (the old one with password has been revoked)
- more certificates for openvpn clients without pass

That should be correct.

What flavour of openvpn are you using? Routed/Bridged/S2S ?

But I don't know what certificates you have actually added to openvpn - possible the private CA by mistake?? That should only be the public cert?

You can test if certs requires a password with openssl.

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline mauro

  • ***
  • 101
  • +0/-0
Re: Questions re PHPKI
« Reply #13 on: August 05, 2021, 02:25:15 PM »
Well, that's embarassing, either I forgot to put the new password-less certificate and key into openvpn, or I did not press save...
Should be ok now, thanks

All parts should go together without forcing. You must remember that the parts you are reassembling were disassembled by you. Therefore, if you can't get them together again, there must be a reason. By all means, do not use a hammer.
-- IBM maintenance manual (1975)

Offline ReetP

  • *
  • 3,731
  • +5/-0
Re: Questions re PHPKI
« Reply #14 on: August 05, 2021, 02:38:13 PM »
Well, that's embarassing, either I forgot to put the new password-less certificate and key into openvpn, or I did not press save...
Should be ok now, thanks

:lol:

We've all been there ;-)

Your penance is to test and verify bugs please!!

https://bugs.koozali.org/buglist.cgi?bug_status=UNCONFIRMED&bug_status=CONFIRMED&bug_status=NEEDINFO&bug_status=IN_PROGRESS&bug_status=RESOLVED&bug_status=VERIFIED&f0=OP&f1=OP&f2=product&f3=component&f4=alias&f5=short_desc&f7=content&f8=CP&f9=CP&j1=OR&list_id=95049&o2=substring&o3=substring&o4=substring&o5=substring&o7=matches&query_format=advanced&v2=phpki-ng&v3=phpki-ng&v4=phpki-ng&v5=phpki-ng&v7=%22phpki-ng%22


If you want to chat to "Terry the Testing King" then ask for a Rocket.Chat account on my server and you can go through how to do testing & verification. He is a great teacher!

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation