Jboss 无法连接到 Apple Push Networks

Jboss 无法连接到 Apple Push Networks

我正在使用 Aerogear Unified Push 服务器向推送网络发送消息。在我的设置中,消息可以正确发送到 Android 网络,但无法发送到 Apple 网络。错误似乎仍然发生在从后端到推送网络的处理上。

我谷歌了一下,可能与网状结构但我不确定。我附上了最相关的日志:

[0m15:36:05,122 DEBUG [org.jboss.aerogear.unifiedpush.message.sender.apns.PushyApnsSender] (Thread-1 (ActiveMQ-client-global-threads-1186871307)) establishing the connection for ab358c33-ca7c-4b26-82d9-528f00a2f4c8
at io.netty.handler.ssl.JdkAlpnApplicationProtocolNegotiator$FailureWrapper.wrapSslEngine(JdkAlpnApplicationProtocolNegotiator.java:113)
at io.netty.handler.ssl.SslContext.newHandler(SslContext.java:903)
at io.netty.channel.ChannelInitializer.initChannel(ChannelInitializer.java:113)
at io.netty.channel.ChannelInitializer.handlerAdded(ChannelInitializer.java:105)
at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:597)
at io.netty.channel.DefaultChannelPipeline$PendingHandlerAddedTask.execute(DefaultChannelPipeline.java:1387)
at io.netty.channel.AbstractChannel$AbstractUnsafe.access$200(AbstractChannel.java:419)
at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:506)
at io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:478)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:462)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
at com.turo.pushy.apns.ApnsClient$3.operationComplete(ApnsClient.java:395)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:507)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:420)
at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:104)
at io.netty.channel.AbstractChannel$AbstractUnsafe.doClose0(AbstractChannel.java:686)
at io.netty.channel.DefaultChannelPipeline$HeadContext.close(DefaultChannelPipeline.java:1276)
at io.netty.channel.AbstractChannelHandlerContext.invokeClose(AbstractChannelHandlerContext.java:624)
at io.netty.channel.ChannelInitializer.initChannel(ChannelInitializer.java:117)
at io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:465)
at io.netty.channel.DefaultChannelPipeline.access$000(DefaultChannelPipeline.java:44)
at io.netty.channel.DefaultChannelPipeline$PendingHandlerAddedTask.execute(DefaultChannelPipeline.java:1387)
at io.netty.channel.DefaultChannelPipeline.callHandlerAddedForAllHandlers(DefaultChannelPipeline.java:1122)
at io.netty.channel.DefaultChannelPipeline.invokeHandlerAddedIfNeeded(DefaultChannelPipeline.java:647)
at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:506)
at io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:478)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403)

答案1

我了解到苹果在其端点上使用 https/2。我们用作部署基础的 Alpine Linux 映像默认不具备支持 https/2 所需的库。

以下 Dockerfile 安装在 Alpine 中实现 https/2 所需的基础设施:

FROM alpine:edge

# For nghttp2-dev, we need this respository.
RUN echo https://dl-cdn.alpinelinux.org/alpine/edge/testing >>/etc/apk/repositories 

ENV CURL_VERSION 7.50.1

RUN apk add --update --no-cache openssl openssl-dev nghttp2-dev ca-certificates
RUN apk add --update --no-cache --virtual curldeps g++ make perl && \
    wget https://curl.haxx.se/download/curl-$CURL_VERSION.tar.bz2 && \
    tar xjvf curl-$CURL_VERSION.tar.bz2 && \
    rm curl-$CURL_VERSION.tar.bz2 && \
    cd curl-$CURL_VERSION && \
    ./configure \
        --with-nghttp2=/usr \
        --prefix=/usr \
        --with-ssl \
        --enable-ipv6 \
        --enable-unix-sockets \
        --without-libidn \
        --disable-static \
        --disable-ldap \
        --with-pic && \
    make && \
    make install && \
    cd / && \
    rm -r curl-$CURL_VERSION && \
    rm -r /var/cache/apk && \
    rm -r /usr/share/man && \
    apk del curldeps
CMD ["curl"]

Curl -v 应该报告 https/2 已启用:

curl -s --http2 -I https://nghttp2.org
HTTP/2 200 

我发现这个程序有记录这里

相关内容