AngularJS $ http返回ERR_SSL_VERSION_OR_CIPHER_MISMATCH

AngularJS $http returns ERR_SSL_VERSION_OR_CIPHER_MISMATCH

I've worked on this issue since yesterday and it's only gotten worse. earlier I was able to send a POST message but not a GET, now I'm unable to do either one. . .

Code: AngularJS Postmethod (I want to insert a entry into a database)

    $scope.submitReport = function(){
    if (typeof($scope.errorReport.numberPlate) == 'undefined'|| typeof($scope.errorReport.brief) == 'undefined' )
        return;
    if (typeof($scope.errorReport.imgUri) != 'undefined') console.log("img is defined");

    var request = $http({
        method: "post",
        url: "http://ekstroms.xyz/motabVerkstad/api.php",
        crossDomain : true,
        data: JSON.stringify({
                        numberPlate: $scope.errorReport.numberPlate,
                        brief: $scope.errorReport.brief,
                        imgUri: $scope.errorReport.imgUri
                    }),
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
    });
    /* Successful HTTP post request or not */
    request.success(function(data) {
        console.log(data);
    });
};

Code: AngulasJS GETmethod (I want to retrieve all entries from a database)

$scope.$on('$ionicView.enter', function(e) {
    var request = $http({
        method: "GET",
        url: "http://ekstroms.xyz/motabVerkstad/api.php" // URL to file
        // ,cache: true // Will enable once I get it to work

    }).then(function successCallback(response) { 
        // this callback will be called asynchronously
        // when the response is available
        console.log('callback data->'+response.data);
        console.log('callback status'+response.status);

    }, function errorCallback(response) {
        // called asynchronously if an error occurs
        // or server returns response with an error status.
        console.log('callback data->'+response.data);
        console.log('callback status->'+response.status);
        console.log(response);
    });
});

Code: PHP (http://ekstroms.xyz/motabVerkstad/api.php)

<?php
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET, OPTIONS');

//http://stackoverflow.com/questions/15485354/angular-http-post-to-php-and-undefined
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $postdata = file_get_contents("php://input");
    if (isset($postdata)) {
        $request = json_decode($postdata);
        $brief = $request->brief;
        $numberPlate = $request->numberPlate;
        $imgUri = $request->imgUri;

        if ($brief != "") {
            echo "Server returns: " . $brief;
        }
        else {
            echo "Empty brief parameter!";
        }

        // Connect to database
        include 'connect.php';
        $db = Database::getInstance();
        $db->connect();

        // Prepare SQL query
        $sql = "INSERT INTO `felrapporter`(`number_plate`, `brief`, `photo`) 
                VALUES ('".$numberPlate."','".$brief."','".$imgUri."')";

        // Request the query
        echo $db->question($sql);
    }
    else {
        echo "Not called properly with brief parameter!";
    }
}
else if ($_SERVER['REQUEST_METHOD'] === 'GET') {
    // Connect to database
    include 'connect.php';
    $db = Database::getInstance();
    $db->connect();

    // $sql = "SELECT * FROM Articles order by Date desc";
    $sql = "SELECT * FROM `felrapporter`;";

    $stmt = $db->question($sql);

    $stmt->setFetchMode(PDO::FETCH_CLASS, 'register');
    // foreach($stmt as $entry) {
    //  $entry->returnArray();
    // } 
    echo json_encode('hej');
    // echo $stmt;
    // $test = $db->question($sql);
    // $numberPlate = 'a';
    // $brief = 'b';
    // $imgUri ='';
    // if ($test) $db->question("INSERT INTO `felrapporter`(`number_plate`, `brief`, `photo`) 
        // VALUES ('".$numberPlate."','".$brief."','".$imgUri."')";)
    // echo $test;
}
?>

Database structure:

CREATE DATABASE motab_verkstad;
USE motab_verkstad;
CREATE TABLE Felrapporter
(
    id int  NOT NULL PRIMARY KEY AUTO_INCREMENT,
    number_plate varchar(32) NOT NULL,
    brief varchar(2048) NOT NULL,
    date DATETIME,
    photo varchar(255)
);
ALTER TABLE `felrapporter` CHANGE `date` `date` DATETIME NULL DEFAULT CURRENT_TIMESTAMP;

Chrome: result from GET is the following:

callback data->null
callback status->0
Object {data: null, status: 0, config: Object, statusText: ""}
GET https://ekstroms.xyz/motabVerkstad/api.php net::ERR_SSL_VERSION_OR_CIPHER_MISMATCH ekstroms.xyz/motabVerkstad/api.php:1 

Chrome: Result from POST

POST https://ekstroms.xyz/motabVerkstad/api.php net::ERR_SSL_VERSION_OR_CIPHER_MISMATCH ekstroms.xyz/motabVerkstad/api.php:1 

Firefox: Result from POST Lots of stuff ... tho, it works fine here

Firefox: Result from POST Nothing..

Apache: subset of error.log

[Sat Jan 30 02:23:48.099594 2016] [:error] [pid 8520:tid 1708] [client 80.244.89.57:4129] PHP Notice:  Undefined property: stdClass::$imgUri in C:\\xampp\\htdocs\\motabVerkstad\\api.php on line 12, referer: http://localhost:8100/
[Sat Jan 30 02:23:48.100594 2016] [:error] [pid 8520:tid 1708] [client 80.244.89.57:4129] PHP Fatal error:  Uncaught Error: Call to a member function query() on null in C:\\xampp\\htdocs\\motabVerkstad\\connect.php:32
Stack trace:
#0 C:\\xampp\\htdocs\\motabVerkstad\\api.php(31): Database->question('INSERT INTO `fe...')
#1 {main}
  thrown in C:\\xampp\\htdocs\\motabVerkstad\\connect.php on line 32, referer: http://localhost:8100/
[Sat Jan 30 02:26:10.718658 2016] [core:error] [pid 8520:tid 1688] [client 80.244.89.57:4176] AH00082: an unknown filter was not added: DEFLATE
[Sat Jan 30 02:26:10.719658 2016] [:error] [pid 8520:tid 1688] [client 80.244.89.57:4176] PHP Notice:  Undefined property: stdClass::$imgUri in C:\\xampp\\htdocs\\motabVerkstad\\api.php on line 12, referer: http://localhost:8100/
[Sat Jan 30 02:26:10.728667 2016] [:error] [pid 8520:tid 1688] [client 80.244.89.57:4176] PHP Fatal error:  Uncaught Error: Call to a member function query() on null in C:\\xampp\\htdocs\\motabVerkstad\\connect.php:32
Stack trace:
#0 C:\\xampp\\htdocs\\motabVerkstad\\api.php(31): Database->question('INSERT INTO `fe...')
#1 {main}
  thrown in C:\\xampp\\htdocs\\motabVerkstad\\connect.php on line 32, referer: http://localhost:8100/

Just for the notes..

  • The apache's php_error.log is empty
  • I'm running PHP 7 (I had an older but updated to see if it would solve anything.. no merits gained, just more work cause I forgot to backup my other databases -.- )

Not sure what else to mention .. I hope I've given a good description of my structure, code and my problem.

Summary: Firefox is able to do $http post requests Chrome isn't able to do $http post nor $http get requests Another issue I've got which is probably irrelevant is firefox is giving me this error as well:

The connection to ws://localhost:35729/livereload was interrupted while the page was loading.