Dear All,
Can't figure out what's wrong with my setup, would be very grateful for assistance.
Drupal 7.x, locked up with SSL
Services module 7.x-3.12 REST server installed

endpoint config below:

$endpoint = new stdClass();
$endpoint->disabled = FALSE; /* Edit this to true to make a default endpoint disabled initially */
$endpoint->api_version = 3;
$endpoint->name = 'service';
$endpoint->server = 'rest_server';
$endpoint->path = 'service';
$endpoint->authentication = array(
'services' => 'services',
);
$endpoint->server_settings = array(
'formatters' => array(
'bencode' => TRUE,
'json' => TRUE,
'jsonp' => TRUE,
'php' => TRUE,
'xml' => TRUE,
),
'parsers' => array(
'application/json' => TRUE,
'application/vnd.php.serialized' => TRUE,
'application/x-www-form-urlencoded' => TRUE,
'application/xml' => TRUE,
'multipart/form-data' => TRUE,
'text/xml' => TRUE,
),
);
$endpoint->resources = array(
'system' => array(
'actions' => array(
'connect' => array(
'enabled' => '1',
),
),
),
'user' => array(
'alias' => 'users',
'operations' => array(
'retrieve' => array(
'enabled' => '1',
),
'create' => array(
'enabled' => '1',
),
'update' => array(
'enabled' => '1',
),
'delete' => array(
'enabled' => '1',
),
'index' => array(
'enabled' => '1',
),
),
'actions' => array(
'login' => array(
'enabled' => '1',
'settings' => array(
'services' => array(
'resource_api_version' => '1.0',
),
),
),
'logout' => array(
'enabled' => '1',
'settings' => array(
'services' => array(
'resource_api_version' => '1.0',
),
),
),
'token' => array(
'enabled' => '1',
),
'request_new_password' => array(
'enabled' => '1',
),
'register' => array(
'enabled' => '1',
),
),
'targeted_actions' => array(
'cancel' => array(
'enabled' => '1',
),
'password_reset' => array(
'enabled' => '1',
),
'resend_welcome_email' => array(
'enabled' => '1',
),
),
),
);
$endpoint->debug = 0;

client php script:
$request_url = 'https://www.oakridge.ee/services/user/login';
$username = 'test user';
$password = '******';
$user_data = array(
'username' => $username,
'password' => $password,
);
$user_data = http_build_query($user_data);
$curl = curl_init($request_url);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Accept: application/json')); // Accept JSON response
curl_setopt($curl, CURLOPT_POST, 1); // Do a regular HTTP POST
curl_setopt($curl, CURLOPT_POSTFIELDS, $user_data); // Set POST data
curl_setopt($curl, CURLOPT_HEADER, FALSE); // Ask to not return Header
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_FAILONERROR, TRUE);
curl_setopt($curl, CURLOPT_COOKIESESSION, true);
//curl_setopt($curl, CURLOPT_COOKIEFILE, "cookie.txt");
//curl_setopt($curl, CURLOPT_COOKIEJAR, "cookie.txt");

$response = curl_exec($curl);
$http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
dpm($response);
dpm($http_code);
if ($http_code == 200) {
$logged_user = json_decode($response);
dpm($logged_user);
// return $logged_user ;
}
else {
$http_message = curl_error($curl);
// return $http_message ;
dpm( $http_message );
}
curl_close($curl);

responce: site front page html
http_code: 200