简体   繁体   English

应用程序和服务器之间的安全连接

[英]Secured connection between app and server

I try these code to connect my ionic app to apiserver (get)我尝试使用这些代码将我的 ionic 应用程序连接到 apiserver (get)

    import { Injectable } from '@angular/core';
    import { HttpClient } from '@angular/common/http';
    import { Observable } from 'rxjs';
    import { map } from 'rxjs/operators';

    @Injectable({
      providedIn: 'root'
    })
    export class EncryptionService {

      url = 'https://api.am....com';
      api-key='......'

      constructor(private http: HttpClient) { }

      newcheck(checkid: string ,cost: string,toname: string,tocode: string,passcode: string,date: string,checkfor: string,back: string): {
          return this.http.get(`${this.url}?key=${this.api-key}&checkid=${encodeURI(checkid)}`);
      }
    }

my API has API key and get data in URL我的 API 有 API 密钥并在 URL 中获取数据

  1. how can i perform these in the secured way?我怎样才能以安全的方式执行这些? for example to prevent someone to listen and monitor transferred data between app and server?例如防止有人监听和监控应用程序和服务器之间传输的数据?
  2. prevent someone to distract and fake received data by app?防止有人通过应用分散注意力并伪造收到的数据?
  3. or, anything to make this connection secured或者,任何使此连接安全的事情

It looks like you're already using https which is encrypted.看起来您已经在使用加密的 https。 A man in the middle attack should be prevented by default since browsers verify the certificate chain automatically.默认情况下应该防止中间人攻击,因为浏览器会自动验证证书链。

I recommend reading this guide about https.我建议阅读有关 https 的指南

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM