Utilizing ionicFramework and ngCordova for secure HTTPS requests

I have encountered an issue where I am able to successfully send a HTTP request and receive a response, but when I attempt to send the request over HTTPS, I receive the following error message: POST " net::ERR_INSECURE_RESPONSE"

Below is the code snippet in question:

   .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

 });


    };       

 })

Answer №1

The reason why the request might be blocked is due to a potential issue with the SSL configuration on the requested resource.

I encountered a similar issue before and managed to resolve it by properly fixing the SSL chain for the HTTPS resource I needed. You can use this website to detect and address any SSL configuration issues:

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Tips for effectively migrating a laravel codebase to a new laravel framework:

Can you provide guidance on successfully backing up a Laravel project or transferring its codebase to a new Laravel project? My current Laravel project is not starting up the built-in Artisan server, which is causing me frustration. I have invested signi ...

Kendo sortable interference with input focus

Utilizing both kendo listview and grid components to display the same information in different views; a primary listview of cards and a table-based grid view, both integrated with the Kendo Sortable widget. The objective is to enable users to edit an inlin ...

Encountering the error message "Undefined variable '$'" in a script that is loaded after jQuery

My code is simple - it loads jQuery first, followed by a script that uses the $ syntax. However, I keep encountering the error: ReferenceError: $ is not defined Initially, I suspected that the async attribute on the script tag was the issue, but changi ...

Unforeseen Extra Information is being transmitted along with Socket.io and Jquery

Issue : There seems to be a problem with the chat message printing an extra character in msg. Upon console logging, an additional object value is appearing in the state. What could be causing this issue? Console log output : 2{"message":"e"} 1{"mess ...

Transmit the map via res.send in Express

My friend and I are collaborating on a game project, but we're encountering an issue when trying to send a Map with some data in it. Instead of receiving the actual Map, Express is sending the user {}. Strangely enough, when I use console.log to check ...

Creating a clickable map for a PNG image: Step-by-step tutorial

My goal is to create a interactive map similar to this one. Click here for the image ...

When working with ng-show and ng-hide in AngularJS, I noticed a brief 1ms delay where both objects are still

I am encountering a similar issue as discussed in the following post: How to use ng-show and ng-hide with buttons in AngularJS In my case, I have play/pause buttons where the ng-show/hide functionality is working. However, the problem lies in the fact tha ...

Notification banner for service maintenance messages with dismiss option available in an Angular application

I need assistance with displaying service messages to users in an Angular application. I want to achieve a similar functionality as showing maintenance-related notifications on Jira board with a dismiss option. The API will provide a list of active message ...

Caching JSON requests in ExtJS

Hey there! I'm currently working with Extjs and have created a grid that contains editable cells. One of these cells needs to be a combobox that retrieves its options from a script generating JSON data. The code for the grid and the combobox-cell-edit ...

Angular - Dividing Functionality into Multiple Modules

I am currently working with two separate modules that have completely different designs. To integrate these modules, I decided to create a new module called "accounts". However, when I include the line import { AppComponent as Account_AppComponent} from &a ...

Using the next/dynamic library to import components in Next.js can be complex and confusing at first

Embarking on my first foray into building a NextJs app for production, I find myself in uncharted territory as a newcomer. My current project involves incorporating PeerJs for real-time communication, yet encountering an issue when attempting to import it ...

Dynamic item addition feature activated by button on contact form

I am looking to create a form that includes the standard name, phone, email fields as well as a dropdown for selecting products and a text box for inputting quantity. The unique aspect is allowing users to add multiple products (dropdown and quantity textb ...

Validation in Angular2 is activated once a user completes typing

My goal is to validate an email address with the server to check if it is already registered, but I only want this validation to occur on blur and not on every value change. I have the ability to add multiple controls to my form, and here is how I have st ...

Preventing form submission when selecting an address from Google Maps autocomplete in AngularJS

I am currently facing an issue with the Google autocomplete address search functionality. Whenever I click or press enter after selecting an address, the form automatically submits. I have tried using the event preventDefault but it doesn't seem to be ...

Using Express in Node.js to send a GET request to a different server from a Node route

When a client triggers a GET request by clicking a button on the index page, it sends data to a route that is configured like this: app.js var route = require('./routes/index'); var button = require('./routes/button'); app.use('/ ...

AngularJS: Assign a class based on a variable's value

I am working with an array of objects, each containing a color variable ('success', 'danger', 'info'). My task is to apply these colors to panels, texts, and buttons as shown below: <div class="panel" ng-class="panel-{{pan ...

Reorganizing an array using a custom prioritized list

Is it possible to sort an array but override precedence for certain words by placing them at the end using a place_last_lookup array? input_place_last_lookup = ["not","in"]; input_array = [ "good", "in", "all&qu ...

Pass an object along with the rendering of the page using ExpressJS and Mongoose

After reading through this post: mongoose find all not sending callback I am currently working on sending an Object along with a page in my nodejs/expressjs application, instead of just responding with JSON data. This is the route for my page: //Get lat ...

What steps are needed to pass an additional parameter to the onMouseDown function in ReactJS?

The TypeScript function listed below demonstrates the functionality: const handleMouseDownHome = (e: any) => { // Only activates when scroll mouse button is clicked if (e.button === 1) { window.open("/", "_blank", " ...

Can you explain the distinctions among <Div>, <StyledDiv>, and <Box sx={...}> within the MUI framework?

When exploring the MUI documentation, I came across a table of benchmark cases that can be found here. However, the differences between the various cases are not clear to me. Can someone please explain these variances with real examples for the following: ...