1

I am able to send a http request and get a resonse succefully, but when I send the request over HTTPS I get the following error POST "https://..../request/addimage net::ERR_INSECURE_RESPONSE"

This Is My Code

   .controller('imageCtrl', function ($scope, $cordovaCamera, $ionicLoading, $http, $ionicPopup, $ionicPopover, $state, userService, $ionicSideMenuDelegate, $rootScope, $cordovaDevice) {

var imageX; //save the base64
           $scope.takePhoto = function(){
             var options = {
                          quality: 50,
                          destinationType: Camera.DestinationType.DATA_URL,
                          sourceType: Camera.PictureSourceType.CAMERA,
                          allowEdit: true,
                          encodingType: Camera.EncodingType.JPEG,
                          targetWidth: 50,
                          targetHeight: 50,
                          popoverOptions: CameraPopoverOptions,
                          saveToPhotoAlbum: false,
                          correctOrientation:true
                        };

        $cordovaCamera.getPicture(options).then(function(imageData) {
          imageX = imageData;



        }, function(err) {
          // error
        });
        };

        $scope.uploadPhoto=function(){

var uuid = $cordovaDevice.getUUID();

    var dataj ={
        image:imageX,
        device_id:uuid,
        picture_format:"jpg"
    };

    $http.post('https://..../request/addimage',dataj)
    .success(function (data) {
 //success


}).
    error(function (data, status) {
  //error

 });


    };       


 })
mulikevs
  • 181
  • 2
  • 17
  • Add this tag may help you : – N.Raval Jan 08 '16 at 09:42
  • May be this link will give solution of your problem :- http://stackoverflow.com/questions/23688565/failed-to-load-resource-neterr-insecure-response – N.Raval Jan 08 '16 at 09:44
  • @N.Raval Adding that tag did not change anything, still getting same response, and the second solution you are talking about deals with google chrome not IonicFramework – mulikevs Jan 08 '16 at 10:13
  • "deal with Google Chrome not Ionic Framework" - but obviously if you are running this in a Chrome browser (or Chrome on Mobile) it may impact you, right? – Raymond Camden Jan 08 '16 at 14:34

1 Answers1

0

The request may be being blocked because something is amiss with the SSL configuration on the resource it is requesting.

I experienced this same problem and solved it by fixing my SSL chain on the resource I was requesting via HTTPS. Try using this site to identify and resolve problems with your SSL configuration: https://www.ssllabs.com/ssltest/analyze.html

Justin Edwards
  • 152
  • 1
  • 11