ID:2170384
 
(See the best response by Nadrew.)
Code:
#include <dantom\cgi\CGI.dme>
CGI
authenticate = 1
Topic(href)
usr << "Got Stuff!<br>"
usr << "Your ckey is [usr.ckey]"


Problem description:

Okay, I'm trying to use DMCGI to authenticate users to my site. I've actually done this before (two years ago) but have misplaced that code. I have a dmb setup as a CGI script; that all works fine and as expected as long as /CGI/authenticate = 0.
I expect that if CGI/authenticate = 1 then any unauthenticated requests will be redirected to beyond.com (which works fine) and then redirected back (which also happens) and I'd know their ckey. However what I get is:

BUG: Unable to determine certification domain

Detailed Details:
1. Request made to https://mydomain/blah/blah.dmb
2. Redirected to https://secure.byond.com/login.cgi/?login=1;url=https:// mydomain/blah/blah.dmb;noscript=1
3. Redirected to https://mydomain/blah/ blah.dmb?byondcert=xxxxxxxxxxxxxxxxxxxxxxxx&byondcertexp=
4. That request errors out.

Environment
Obviously on linux.
I have tried this with BYOND 470.1075, 500.1205, and 510.1346 with the same effect.
Best response
You need to make sure the web-server's user has a .byond in the webserver root.

sudo mkdir /var/www/.byond
sudo mkdir /var/www/.byond/cache
sudo mkdir /var/www/.byond/cfg
sudo chown -R www-data:www-data /var/www/.byond
sudo chmod -R 755 /var/www/.byond


Assuming the root for the webserver is /var/www.
In response to Nadrew
Excellent, that is exactly it, thank you!

Unfortunately the error message is not particularly intuitive. In fact as soon as I read your post I suddenly remembered having to figure this out using strace two years ago. At least now the next person will find this post when googling the error message.