Не удается отправить сообщение Firebase Cloud из IBM Websphere Liberty Server в мое приложение Android - PullRequest
0 голосов
/ 30 апреля 2020

Я изучаю Firebase Cloud Messaging в моем текущем Android приложении.

Я успешно интегрировал FCM в свое приложение Android и использовал консоль Firebase для отправки тестовых сообщений.

Сейчас я пытаюсь разработать свой сервер приложений для управления обменом сообщениями, однако его сбой происходит следующим образом: -

[ERROR   ] CWPKI0823E: SSL HANDSHAKE FAILURE:  A signer with SubjectDN [CN=upload.video.google.com, O=Google LLC, L=Mountain View, ST=California, C=US] was sent from the host [oauth2.googleapis.com:443].  The signer might need to be added to local trust store [/Users/josephDanielCasolaro /__NOTIFICATION/server/wlp/usr/servers/defaultServer/resources/security/key.p12], located in SSL configuration alias [defaultSSLConfig].  The extended error message from the SSL handshake exception is: [PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target].

мой сервер приложений работает локально. Подробности следующие: -

Launching defaultServer (WebSphere Application Server 20.0.0.4/wlp-1.0.39.cl200420200401-1714) on OpenJDK 64-Bit Server VM, version 11.0.2+9 (en_GB)

Мой сервер профиля свободы xml похож на это: -

<server description="new server">

    <!-- Enable features -->
    <featureManager>
        <feature>webProfile-8.0</feature>
        <feature>localConnector-1.0</feature>
    </featureManager>

    <!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
    <httpEndpoint httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint"/>

  <!-- Automatically expand WAR files and EAR files -->
    <applicationManager autoExpand="false"/>

    <keyStore id="defaultKeyStore" password="yourPassword"/>

    <applicationMonitor updateTrigger="mbean"/>
    <webTarget uri=""/>

    <webApplication id="Aardvarking" location="Aardvarking.war" name="Aardvarking"/>
</server>

Мой код сервера похож на: -

final InputStream serviceAccount = getClass().getClassLoader()
                .getResourceAsStream("/my-project.json");


        FirebaseOptions options = new FirebaseOptions.Builder()
                .setCredentials(GoogleCredentials.fromStream(serviceAccount))
                .setDatabaseUrl("https://my-project.firebaseio.com").build();

        FirebaseApp.initializeApp(options);


        // This registration token comes from the client FCM SDKs.
        final String registrationToken = "xxx-xxx-xxx-xxx";

        // See documentation on defining a message payload.
        final Message message = Message.builder().putData("score", "850").putData("time", "2:45").setToken(registrationToken)
                .build();

        // Send a message to the device corresponding to the provided
        // registration token.
        String response = FirebaseMessaging.getInstance().send(message);
        // Response is a message ID string.
        System.out.println("Successfully sent message: " + response);

Где я ошибся?

Это проблема конфигурации сервера профиля свободы?

...