4c630eb1d90ef9c268aeff3700814575bdf24ed6
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

1) <?php
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4) 
Bernd Wurst Copyright year update

Bernd Wurst authored 6 years ago

5) Written 2008-2018 by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

6)   Bernd Wurst <bernd@schokokeks.org>
7)   Hanno Böck <hanno@schokokeks.org>
8) 
9) To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
10) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

12) http://creativecommons.org/publicdomain/zero/1.0/
13) 
14) Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
15) */
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

16) 
17) include_once('certs.php');
18) require_role(ROLE_SYSTEMUSER);
19) 
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

20) $hint = '';
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

21) $oldcert = null;
22) if (isset($_REQUEST['replace'])) {
23)     title('Zertifikat ersetzen');
Bernd Wurst Titel und Hilfetext auf der...

Bernd Wurst authored 11 years ago

24) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

25)     $cert = cert_details($_REQUEST['replace']);
26)     $oldcert = $cert['id'];
27)     $hint = "<div style=\"border: 2px solid red; padding: 1em; margin: 1em;\"<p><strong>Hinweis:</strong> Dieses Zertifikat soll als Ersatz für ein bestehendes Zertifikat eingetragen werden. Dabei wird jede Benutzung des alten Zertifikats durch das neue ersetzt. Das alte Zertifikat wird dann umgehend gelöscht.<p>
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

28) 
29) <p><strong>Daten des alten Zertifikats:</strong></p>
Bernd Wurst Neuer Workflow für Cert-Rep...

Bernd Wurst authored 11 years ago

30) <p><strong>CN:</strong> {$cert['cn']}<br /><strong>Gültigkeit:</strong> {$cert['valid_from']} - {$cert['valid_until']}</p></div>";
Bernd Wurst Titel und Hilfetext auf der...

Bernd Wurst authored 11 years ago

31) } else {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

32)     title('Neues Server-Zertifikat hinzufügen');
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

33) }
34) 
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

35) 
Bernd Wurst Titel und Hilfetext auf der...

Bernd Wurst authored 11 years ago

36) $section = 'vhosts_certs';
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

37) 
38) 
Bernd Wurst Neuer Workflow für Cert-Rep...

Bernd Wurst authored 11 years ago

39) output($hint.'
40) <h4>CSR automatisch erzeugen</h4>
Bernd Wurst Interface für Zertifikate i...

Bernd Wurst authored 7 years ago

41) <p>Mit unserem CSR-Generator können Sie einen Certificate-signing-request (CSR) automatisch erzeugen lassen. Nutzen Sie diese Möglichkeit bitte nur, wenn Sie ein so genanntes "Domain validated"-Zertifikat beantragen werden, das keine persönlichen Daten bzw. Firmendaten enthält.</p>');
Bernd Wurst Neuer Workflow für Cert-Rep...

Bernd Wurst authored 11 years ago

42) 
43) if ($oldcert) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

44)     $cn = urlencode($cert['cn']);
45)     addnew('savecert', "Einen neuen CSR für {$cert['cn']} erzeugen lassen", "action=newcsr&commonname={$cn}&replace={$oldcert}");
Bernd Wurst Neuer Workflow für Cert-Rep...

Bernd Wurst authored 11 years ago

46) } else {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

47)     addnew('newcsr', 'CSR automatisch erzeugen lassen');
Bernd Wurst Neuer Workflow für Cert-Rep...

Bernd Wurst authored 11 years ago

48) }
49) 
50) 
51) output('<h4>Vorhandenes Zertifikat eintragen</h4>
Bernd Wurst Interface für Zertifikate i...

Bernd Wurst authored 7 years ago

52) <p>Sie können Ihr eigenes TLS-Zertifikat hinterlegen, das Sie dann für eine oder mehrere Webserver-Konfigurationen verwenden können.</p>
Bernd Wurst Neuer Workflow für Cert-Rep...

Bernd Wurst authored 11 years ago

53) ');
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

54) 
55) 
56) $form = '
57) <h4>Server-Zertifikat:</h4>
58) <p><textarea name="cert" rows="10" cols="70"></textarea></p>
59) 
Bernd Wurst Ermögliche einen Zertifikat...

Bernd Wurst authored 10 years ago

60) <h4>privater Schlüssel:</h4>';
61) 
62) if ($oldcert) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

63)     $form .= '<p>Wenn Ihre Zertifizierungsstelle einen echten <em>renew</em>-Vorgang durchführt und das Zertifikat basierend auf dem alten CSR neu ausgestellt hat, brauchen Sie hier keinen privaten Schlüssel anzugeben.</p>';
Bernd Wurst Ermögliche einen Zertifikat...

Bernd Wurst authored 10 years ago

64) }
65) 
66) $form .= '<p><textarea name="key" rows="10" cols="70"></textarea></p>
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

67) 
68) <p><input type="submit" value="Speichern" /></p>
69) 
70) ';
71) 
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

72) output(html_form('vhosts_certs_new', 'savecert', 'action=new&replace='.$oldcert, $form));
Bernd Wurst Titel und Hilfetext auf der...

Bernd Wurst authored 11 years ago

73) 
74) output('<p>Es ist ein <strong>Zertifikat</strong> und ein dazu passender <strong>privater Schlüssel</strong> (ohne Passwort!) nötig. Alle Daten müssen im <strong>PEM-Format</strong> vorliegen, also in etwa die Form</p>
75) <pre>-----BEGIN CERTIFICATE-----
76) ...
77) -----END CERTIFICATE-----</pre>