Hi,

i just though about some kind of message telling the user about the fact that if a SSL site got cloned, the new one will be non-ssl. I had a different "default" host and when tried to connect to https://cloned .. i landed there without really knowing this ..

I think that we could deal with this 2 ways: 1. let people chose the "SSL settings" in the clone dialog.(I think thats just to much work and not really neded here) 2. just give the admin a note (if he is currently clonine a SSL site) that the new site will be note SSL. If he needs SSL support he should edit the site after it got cloned ( i think that is totaly fine and will fit the needs).

I think 2. will be a easy-fix ( rather addition ) and will help users understanding the result of cloning and avoid issues.

CommentFileSizeAuthor
#15 ssl_do_not_clont.patch640 bytesEugenMayer
#4 ssl_disable.patch551 bytesEugenMayer
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

EugenMayer’s picture

Project: Provision » Hostmaster (Aegir)
Version: » 6.x-0.2-beta1

moving over to hostmaster ..beta2

EugenMayer’s picture

Title: Cloning SSL sites will lead to a non SSL site » [SSL] Cloning SSL sites will lead to a non SSL site .. but certificate is still copied
Project: Hostmaster (Aegir) » Provision
Category: feature » bug

Back to provision ... due to the bug.

Well as described, cloning a SSL site would normaly lead to a non SSL site. But it seems that the backend even copys the wildcard, eventhough it will not be valid most probably ( clone -> different domain ).

I discovered this by this error during cloning:
There are no more IP addresses available on $XXXXX for the $OLDCERT certificate.

We should not try to copy any SSL certs over to the new server ( remote or not ), the site should be non-SSL and should if needed, edited later on. With the current approach, you cannot clone a site from a remote, when the site is a SSL site, if you already have SSL sites on the other hosts ( with a different SSL cert ) .. as the wrong cert is tried to get copied.

EugenMayer’s picture

Just verified that

Running: /var/www/drush/drush.php --context_type='site' .... --backend provision-save '@NEWALIAS' --backend
Has the wrong arguments for SSL ( the SSL cert of the old remote / site, which is doomed to fail if the new remote has own certs )

EugenMayer’s picture

Status: Active » Needs review
FileSize
551 bytes

patch attached

EugenMayer’s picture

Component: Documentation » Code
anarcat’s picture

Component: Code » Documentation
Status: Needs review » Needs work

Those changes at least warrant a comment in the code explaining why we scrap the SSL config. I also feel it just works around the symptom instead of fixing the problem altogether. This error is the key here:

There are no more IP addresses available on $XXXXX for the $OLDCERT certificate.

When you clone, you usually migrate to a new domain name, which will require a new IP... so that's an expected behavior. We certainly have a usability issue here, at the very least, and I agree that we should do our best to keep SSL when cloning, but sometimes it's just not possible.

See also #993944: ssl rollback failure.

EugenMayer’s picture

Component: Code » Documentation

Well actually in my opinion you should not keep the SSL certificate at all. The reason for that is in your argumentation:

If you clone, you have a new domain.

That means the SSL cert will not be valid anymore. And even if it is a wildcard domain the base is most probably different. In my case e.g. i move the site from foo.domain1.tld to foo.domain2.tld ... both domain1 and domain2 have their own wildcard certs.

keeping the cert would never be possible, because on domain2.tld a site is already deployed, called bar.domain2.tld. Thats why the cert of the other remote cannot be installed ( 2 ssl certs on 1 IP -> not possible ).

In any ways the current implementation is buggy. Even if we stay with your argumentation, after finishing the cloning you will see that the site will be not SSL, eventhough the SSL cert has been cloned over to the server (what is useless).

I think we really have to seperate this into 2 issue:
- Should the SSL certificate be cloned at all? Should the user get asked? Should he get warned if it is not possible before cloning <- pretty complicated
- If a SSL site should be clone to an non SSL site, dont clone the SSL settings ( dont push the ssl cert on the remote ) <--- Our current case

anarcat’s picture

Component: Documentation » Code

The SSL cert *could* be valid. In your example, we clone from foo.example1.com to foo.example2.com. But what if we would clone from foo.example1.com to foo1.example1.com and there was a wildcard SSL for *.example1.com? We could keep the certificate.

So I think we *could* keep the cert (and we should do our best to do so). I agree with your patch as a temporary workaround, though, but it needs to have a comment in the code to indicate why we drop the cert.

Even if we can't keep the original cert, I think we can totally create a new generic one the way we do on new sites.

I agree this is a bug.

omega8cc’s picture

Component: Code » Documentation

I think the cloned site should never inherit any SSL stuff, as clone is always related to creating "new" site instance (or copy).

But migrate (and rename?) should inherit it, as it should be allowed during site development etc.

omega8cc’s picture

Component: Documentation » Code

Oops, unintended change.

omega8cc’s picture

Also, we never know if the certificate is a wildcard cert or not, so we probably should assume it isn't, by default.

In case it is a wildcard, then the admin would need to enable SSL with the same cert on cloned site, as it requires new IP etc, so it needs more admin work anyway, besides just cloning the site.

EugenMayer’s picture

There is a other bug hidden here, iam not sure i explained that properly. Even if we keep the certicate with the current code ( lets assume we could, like in your example) the site will end up beeing not SSL. That is most probably related to the site node created with wrong values ( not SSL values ). Also the configuration file will be accordingly to ssl=0, so no SSL entry ( 443 ) at all.

Reproduce by:
- create a ssl site foo.domain1.tld
- clone that site to foo1.domain1.tld
- You will end up having foo1.domain1.tld beeing not SSL

Should i create an extra issue? (i guess so)

EugenMayer’s picture

Component: Documentation » Code
Status: Needs work » Needs review

Well actually, whats missing here?

anarcat’s picture

Status: Needs review » Needs work

I have already explained what is missing here:

Those changes at least warrant a comment in the code explaining why we scrap the SSL config. I also feel it just works around the symptom instead of fixing the problem altogether.

Please do not change the status needlessly (ie. there was no new patch uploaded).

EugenMayer’s picture

Status: Needs work » Needs review
FileSize
640 bytes

comment added

anarcat’s picture

Looks better! I think this can be committed if it's tested and works... I'll see if I can get around to that soon.

Thanks for your contribution.

anarcat’s picture

Status: Needs review » Fixed

Fix committed. I took the liberty of changing the comment to mark them more clearly as needs work and mention wildcards.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 33ae575 on prod-koumbit, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x by anarcat:
    #1057736 by EugenMayer - disable SSL when cloning sites
    
    I fixed up the...