有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java文本安全服务器、信号安卓应用程序和推送服务器配置

我想建立我自己的安全信息服务(TextSecure Server+PushServer+Android App+另一个必要的项目) 如何在我的服务器上运行TextSecure Server? 首先,我用maven构建了WebSocket资源。 其次,我构建了TextSecure服务器。(mvn清洁安装-DskipTests) 在我运行java-jar target/textsecure服务器之后。jar服务器配置/server。yml

我变了

buildConfigField "String", "TEXTSECURE_URL", "\"https://my_server_ip:8080\""

排队。gradle文件(Android应用程序)

但我错了 第一个错误(客户端)->;连接错误。。。。无法连接到推送服务

第二个错误(textsecure server)---->

WARN [2015-12-01 13:45:43,789] org.eclipse.jetty.http.HttpParser: Illegal character 0x16 in state=START for buffer HeapByteBuffer@4c112d16[p=1,l=208,c=8192,r=207]={\x16<<<\x03\x01\x00\xCb\x01\x00\x00\xC7\x03\x01V]\xA4\xC1\x08e\xC6...\x01\x00\x02\x00\x03\x00\x0f\x00\x10\x00\x11\x00#\x00\x00>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00} WARN [2015-12-01 13:45:43,789] org.eclipse.jetty.http.HttpParser: badMessage: 400 Illegal character 0x16 for HttpChannelOverHttp@3669e012{r=0,c=false,a=IDLE,uri=-} WARN [2015-12-01 13:45:43,795] org.eclipse.jetty.http.HttpParser: Illegal character 0x16 in state=START for buffer HeapByteBuffer@86064c8[p=1,l=118,c=8192,r=117]={\x16<<<\x03\x00\x00q\x01\x00\x00m\x03\x00V]\xA4\xC1\xAe\x9a\xEf...\x15\x00\x12\x00\x03\x00\x08\x00\x14\x00\x11\x00\xFf\x01\x00>>>e\r\n\r\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00} WARN [2015-12-01 13:45:43,796] org.eclipse.jetty.http.HttpParser: badMessage: 400 Illegal character 0x16 for HttpChannelOverHttp@6fdc750b{r=0,c=false,a=IDLE,uri=-}

我能做什么


共 (2) 个答案

  1. # 1 楼答案

    在安装TextSecure server之前,我经历了几次颠簸,然后才能启动并运行它。 主要的模块是websocket资源部分(您已经了解了)。 从错误中可以看出,推送服务器似乎无法访问且配置不正确。看看我的writeup,看看这是否有帮助。 推送服务器和文本安全服务的配置部分都非常重要,可能会给您留下一个混乱的包

    构建和编译

    1. 克隆文本安全(信号)服务器
      git clone https://github.com/lucaconte/Signal-Server.git
    2. 克隆推送服务器
      git clone https://github.com/lucaconte/PushServer.git
    3. 克隆WebSocket资源
      git clone https://github.com/lucaconte/WebSocket-Resources.git
    4. 在推送服务器pom中。xml,将capsule.maven.plugin.version版本更改为1.0.1
    5. 构建推送服务器(从此文件夹中)
      mvn clean install
    6. 下载&;安装gpg4win gpg工具进行签名)
      https://www.gpg4win.org/download.html : https://files.gpg4win.org/gpg4win-vanilla-2.3.3.exe
    7. 确保为gpg设置了环境变量
      GNUPGHOME : c:\Users\<username>\AppData\Roaming\gnupg //or whatever path it is
    8. 通过打开gpg2创建默认的secringpubring。来自安装位置的exe文件
    9. 退出显示“键入消息”的已打开终端
    10. 构建推送Websocket资源(从thsi文件夹内部)
      mvn clean install
    11. 构建将在javadoc签名时失败,但没关系,因为我们在目标文件夹(websocket-resources-0.4.1)中获得了主二进制文件
    12. 在maven repo中链接此文件(确保文件和命令中的版本相同)
      mvn install:install-file -Dfile=./library/target/websocket-resources-0.4.1.jar -DgroupId=org.whispersystems -DartifactId=websocket-resources -Dversion=0.4.1 -Dpackaging=jar
    13. 现在构建信号服务器(从信号服务器文件夹内部)
      mvn clean install -DskipTests

    创建配置文件

    推送服务器。yml

    redis:
      url: redis://localhost:6379/2
    
    authentication:
      servers:
        -
          name: 123
          password: 123
    gcm:
      xmpp: false
      apiKey: <INPUT HERE>
      senderId: <INPUT HERE>
      redphoneApiKey: AIddSyAsviyMy8jKe8chCEfr8NbeqGghy7oOCi4 #fake
    
    
    apn:
      feedback: false
      pushKey: /path/to/your/apnpushcertificates/apns-dev-key-noenc.pem #fake
      voipKey: /path/to/your/apnpushcertificates/apns-dev-key-noenc.pem #fake
      voipCertificate: /path/to/your/apnpushcertificates/apns-dev-cert.pem #fake
      pushCertificate: /path/to/your/apnpushcertificates/apns-dev-cert.pem #fake
    
    server:
        applicationConnectors:
        - type: http
          port: 9090
        adminConnectors:
        - type: http
          port: 9091
        gzip:
            enabled: true
    
    logging:
      level: INFO
      appenders:
        - type: file
          currentLogFilename: /tmp/pushserver.log
          archivedLogFilenamePattern: /tmp/pushserver-%d.log.gz
          archivedFileCount: 5
        - type: console
    

    文本安全。yml

    # This is the sample config/textsecure.yml file for the TextSecure Server
    # Pay attention! To start TextSecur server you will need to install and start PushServer
    
    twilio:
      accountId: <INPUT HERE>
      accountToken: <INPUT HERE>
      numbers:
        -
          +33756796138 #fake
      localDomain: foo.org
    
    push:
      host: localhost
      port: 9090
      username: 123
      password: 123
    
    s3:
       accessKey: ABCDEFGCUFYDHVM2LXXX #fake
       accessSecret: W0UfGDddfAbqYyCTIIbSQlDtreTGokOs0OTpL0SE #fake
       attachmentsBucket: thenameofyouts3buket #fake
    
    directory:
      url: "redis://localhost:6379/0"
    
    cache:
      url: "redis://localhost:6379/1"
    
    server:
      applicationConnectors:
        - type: http
          port: 8080
          #keyStorePath: config/example.keystore
          #keyStorePassword: example
          #validateCerts: true
      adminConnectors:
        - type: http
          port: 8081
          #keyStorePath: config/example.keystore
          #keyStorePassword: example
          #validateCerts: true
    
    
    websocket:
      enabled: true
    
    messageStore: # Postgres database configuration for message store
      driverClass: org.postgresql.Driver
      user: "postgres"
      password: "postgres"
      url: "jdbc:postgresql://localhost:5432/messagedb"
    
    database:
      driverClass: org.postgresql.Driver
      user: "postgres"
      password: "postgres"
      url: "jdbc:postgresql://localhost:5432/accountsdb"
      properties:
        charSet: UTF-8
    
    #federation: # is disabled
    
    logging:
      level: INFO
      appenders:
        - type: file
          currentLogFilename: /tmp/textsecureshserver.log
          archivedLogFilenamePattern: /temp/textsecureserver-%d.log.gz
          archivedFileCount: 5
        - type: console
    
    
    redphone:
      authKey: 1234567890 #fake
    

    放置推送服务器。推送服务器文件夹中的yml
    把短信放在安全的地方。yml位于Text Sexure/config文件夹中

  2. # 2 楼答案

    仅对于消息服务,您需要安装PushServer并成功启动它。要成功启动它,您需要创建Google开发者帐户、Apple开发者帐户,并获取推送凭据以发送推送通知

    在TextSecure server中,您需要如下配置推送服务器:

    文本服务器推送部分

    push:
      host: 192.168.10.10
      port: 8080
      username: 123
      password: 123
    

    推送服务器凭据

    authentication:
      servers:
        -
          name: 123
          password: 123