Error Opening Socket... Windows XIG

35 views
Skip to first unread message

Paul Richardson

unread,
Oct 13, 2016, 11:29:16 AM10/13/16
to xbee-internet-gateway

Hi - I posted this as an issue but hoped some might help here as I'm a bit pressed to get my students up and running. ty


When I run xig_app.exe I am getting the following error. Never had this issue in the past. Has something changed?


Error opening socket: hostname 'my.idigi.com' doesn't match u'EDP Device Certificate'


XIG Windows 1.4.2 (or 1.4.1)
XBee S1
Windows 7

Gil Martinez, Francisco

unread,
Oct 13, 2016, 11:50:12 AM10/13/16
to xbee-inter...@googlegroups.com

I have found something to "solve" the issue easily meanwhile I look forward another solution.

 

In the settings.json file if we remove the value "idigi-ca-cert-public.crt" in the "idigi_certs_file" setting, XIG will try to connect using SSL instead of the certificate, and it starts correctly. So meanwhile I find another solution, this workaround should be enough.

 

Best regards!

--
You received this message because you are subscribed to the Google Groups "xbee-internet-gateway" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xbee-internet-ga...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paul Richardson

unread,
Oct 13, 2016, 12:24:44 PM10/13/16
to xbee-inter...@googlegroups.com
Thanks a bunch Gil... Works great.

To unsubscribe from this group and stop receiving emails from it, send an email to xbee-internet-gateway+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "xbee-internet-gateway" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xbee-internet-gateway/i1UkUTAt9NY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xbee-internet-gateway+unsub...@googlegroups.com.

Paul Richardson

unread,
Oct 17, 2016, 1:38:11 PM10/17/16
to xbee-internet-gateway
It works if I test via Device Cloud API explorer but won't when doing a http post from a php script. Same script used
to work fine before the cert problem... Error below is returned.

<error>
HTTP Status 401 - Failed to decode basic authentication token

type Status report

message Failed to decode basic authentication token

description This request requires HTTP authentication.
</error>

Below is the login and post in the php script. Any thought on how to change this without the cert being used? ty
<?
   // HTTP post code with basic auth below, thanks to Jonas John: http://www.jonasjohn.de/snippets/php/post-request.htm
    // Set up basic auth string
    $idigi_auth = base64_encode($idigi_username . ":" . $idigi_password);
    substr_replace($idigi_auth,"",-1);
    
    // parse the given URL
    $url = parse_url($idigi_sci_url);
    if ($url['scheme'] != 'http') { 
        die('Error: Only HTTP request are supported !');
    }
echo "3"  +"\n";
    // extract host and path:
    $host = $url['host'];
    $path = $url['path'];
    
    // open a socket connection on port 80 - timeout: 30 sec
    $fp = fsockopen($host, 80, $errno, $errstr, 30);
echo "4"  +"\n";
    if ($fp){
        // send the request headers:
        fputs($fp, "POST $path HTTP/1.1\r\n");
        fputs($fp, "Host: $host\r\n");
        fputs($fp, "Authorization: Basic " . $idigi_auth);
        fputs($fp, "Content-type: text/xml; charset=\"UTF-8\"\r\n");
        fputs($fp, "Content-length: ". strlen($data) ."\r\n");
        fputs($fp, "Connection: close\r\n\r\n");
        fputs($fp, $data);
        $result = ''; 
        while(!feof($fp)) {
            // receive the results of the request
            $result .= fgets($fp, 128);
        }
    }
echo "5"  +"\n";
    // close the socket connection:
    fclose($fp);
    // split the result header from the content
    $result = explode("\r\n\r\n", $result, 2);
    $header = isset($result[0]) ? $result[0] : '';
    $content = isset($result[1]) ? $result[1] : '';
    // Echo any error responses from iDigi:
    echo $content;
?>

To unsubscribe from this group and stop receiving emails from it, send an email to xbee-internet-gateway+unsub...@googlegroups.com.

Paul Richardson

unread,
Oct 18, 2016, 7:24:24 PM10/18/16
to xbee-internet-gateway
Solved...

Problem was the new digi account I was using. Apparently it wasn't a developer account. All
work fine now. ty
Reply all
Reply to author
Forward
0 new messages