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

标签 javascript angular security ionic-framework penetration-testing

我尝试使用这些代码将我的 ionic 应用程序连接到 apiserver(获取)

    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)}`);
      }
    }

我的 API 有 API key 并在 URL 中获取数据

  1. 我如何以安全的方式执行这些操作? 例如防止某人监听和监控应用程序和服务器之间传输的数据?
  2. 防止有人分散注意力并伪造应用程序收到的数据?
  3. 或者任何可以确保此连接安全的措施

最佳答案

您似乎已经在使用加密的 https。 默认情况下应该防止中间人攻击,因为浏览器会自动验证证书链。

我建议阅读this guide关于https。

关于javascript - 应用程序和服务器之间的安全连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61142853/

相关文章:

php - 防止访问PHP中某个目录之外的文件

javascript - 模式在我的代码中不起作用

javascript - 使用 ember-data 访问 SoundCloud 中的嵌套对象 json

javascript - 在js中重新启用对键盘的访问

javascript - KnockoutJS 中变量 $data 的来源和用途是什么?

angular - Webpack 5 Module Federation 微前端和 Nx monorepos 是互斥的吗?

angular - 带有方法的对象上的 Typescript 展开运算符

angular - ngOnDestroy 可以在 ngAfterContentInit 之前发生吗?

security - SSL 真的值得吗?

java - 身份验证真的需要 JAAS 吗?