Koozali.org: home of the SME Server

Custom certificate changing to default

Offline bpivk

  • *
  • 908
  • +0/-0
    • http://www.bezigrad.com
Custom certificate changing to default
« on: November 19, 2006, 08:16:55 PM »
Hy
I have a little problem

I made a custom certificate using the old howto on phpwiki. The certificate has the right admin e-mail. The certificate that sme builds has the mail admin@server.name.com and my custom certificate uses the mail admin@name.com. So i need to do something to force the server to use my certificate (which gets deleted when i do some updating or something similar) or to modify the custom template to show the proper mail.

Now how could i do something like that?
"It should just work" if it doesn't report it. Thanks!

Offline dmay

  • *
  • 450
  • +0/-0
    • http://myezserver.com
Custom certificate changing to default
« Reply #1 on: November 19, 2006, 09:01:00 PM »
http://bugs.contribs.org/show_bug.cgi?id=1689

The above Bug Tracker ticket includes a custom template of ssl.crt that overrides the default admin e-mail of admin@$FQDN to admin@$DomainName. In addition it permits you to overide the certificate common name. The code below walks you through all required steps:

Code: [Select]
mkdir -p /etc/e-smith/templates-custom/home/e-smith
cd /etc/e-smith/templates-custom/home/e-smith
wget http://bugs.contribs.org/attachment.cgi?id=635 -O ssl.crt
/sbin/e-smith/config setprop modSSL CommonName "blah"
signal-event domain-modify

Darrell

Offline bpivk

  • *
  • 908
  • +0/-0
    • http://www.bezigrad.com
Custom certificate changing to default
« Reply #2 on: November 19, 2006, 10:47:10 PM »
Thanks
I noticed that post but i didn't notice the difference between @$FQDN and @$DomainName.  :oops:

This is just what i need.
But where do i insert my Common Name?
Is this a remake of the file found in phpwiki or it's the same file as the original from SME only that the @$FQDN and @$DomainName are changed?
"It should just work" if it doesn't report it. Thanks!

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Custom certificate changing to default
« Reply #3 on: November 19, 2006, 11:51:02 PM »
Quote from: "bpivk"
Thanks
I noticed that post but i didn't notice the difference between @$FQDN and @$DomainName.  :oops:

This is just what i need.
But where do i insert my Common Name?
Is this a remake of the file found in phpwiki or it's the same file as the original from SME only that the @$FQDN and @$DomainName are changed?


The one from the wiki starts with..
Code: [Select]
{
    use constant KEYLIFEINDAYS => 365;
    use Cwd;
    my $here = getcwd;

    my $FQDN = "$SystemName.$DomainName";
    my $crt = "/home/e-smith/ssl.crt/$FQDN.crt";
    my $key = "/home/e-smith/ssl.key/$FQDN.key";
    my $defaultCity = $ldap{defaultCity};
    my $defaultCompany = $ldap{defaultCompany};
    my $defaultDepartment = $ldap{defaultDepartment};
    my $email = "admin\@$DomainName";
    my $CommonName = "server.example.com";


You have probably Modified the CommonName just do the same for email.

Replace  admin\@$DomainName with your email address.

Then
Code: [Select]
signal-event domain-modify

Admittedly, Dmays method is more flexible.
Regards,
William

IF I give advise.. It's only if it was me....

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Custom certificate changing to default
« Reply #4 on: November 19, 2006, 11:59:03 PM »
In fact, admin\@$DomainName IS probably what you want.

We are talking the same how-to..
http://no.longer.valid/phpwiki/index.php/Creating%20a%20Custom%20signed%20SSL%20Certificate

and you did put the new ssl.crt file into

Code: [Select]
/etc/e-smith/templates-custom/home/e-smith

Note the templates-custom directory.
Regards,
William

IF I give advise.. It's only if it was me....

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Custom certificate changing to default
« Reply #5 on: November 20, 2006, 12:08:00 AM »
Quote from: "bpivk"

But where do i insert my Common Name?
Is this a remake of the file found in phpwiki


You do not modify ssl.crt if you use the dmay method.

Set your CommonName via the configuration database with the command..
Code: [Select]
/sbin/e-smith/config setprop modSSL CommonName "blah" where "blah" is your CommonName.

It was spelt out in dmay's first post.
Regards,
William

IF I give advise.. It's only if it was me....

Offline bpivk

  • *
  • 908
  • +0/-0
    • http://www.bezigrad.com
Custom certificate changing to default
« Reply #6 on: November 20, 2006, 02:44:12 PM »
Ok, got it

Thanks
"It should just work" if it doesn't report it. Thanks!