Closed rkim-branch closed 9 months ago
I think I know what's going on. It seems to me that MeasurementAPIs are not supporting insecure protocols for the development purposes.
11-21 22:24:42.964 9965 9986 E AndroidRuntime: java.lang.ClassCastException: com.android.okhttp.internal.huc.HttpURLConnectionImpl cannot be cast to javax.net.ssl.HttpsURLConnection
11-21 22:24:42.964 9965 9986 E AndroidRuntime: at com.android.adservices.service.measurement.MeasurementHttpClient.setup(MeasurementHttpClient.java:63)
11-21 22:24:42.964 9965 9986 E AndroidRuntime: at com.android.adservices.service.measurement.registration.AsyncSourceFetcher.openUrl(AsyncSourceFetcher.java:705)
11-21 22:24:42.964 9965 9986 E AndroidRuntime: at com.android.adservices.service.measurement.registration.AsyncSourceFetcher.fetchSource(AsyncSourceFetcher.java:724)
11-21 22:24:42.964 9965 9986 E AndroidRuntime: at com.android.adservices.service.measurement.registration.AsyncRegistrationQueueRunner.processSourceRegistration(AsyncRegistrationQueueRunner.java:147)
11-21 22:24:42.964 9965 9986 E AndroidRuntime: at com.android.adservices.service.measurement.registration.AsyncRegistrationQueueRunner.runAsyncRegistrationQueueWorker(AsyncRegistrationQueueRunner.java:133)
11-21 22:24:42.964 9965 9986 E AndroidRuntime: at com.android.adservices.service.measurement.registration.AsyncRegistrationQueueJobService.lambda$onStartJob$0(AsyncRegistrationQueueJobService.java:76)
11-21 22:24:42.964 9965 9986 E AndroidRuntime: at com.android.adservices.service.measurement.registration.AsyncRegistrationQueueJobService.$r8$lambda$LxvrB95zsg4TwWvAtnjhjajaYYI(AsyncRegistrationQueueJobService.java:0)
11-21 22:24:42.964 9965 9986 E AndroidRuntime: at com.android.adservices.service.measurement.registration.AsyncRegistrationQueueJobService$$ExternalSyntheticLambda0.run(R8$$SyntheticClass:0)
11-21 22:24:42.964 9965 9986 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
11-21 22:24:42.964 9965 9986 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
11-21 22:24:42.964 9965 9986 E AndroidRuntime: at java.lang.Thread.run(Thread.java:1012)
I also tried to use self signed certificate, but it didn't work
11-22 08:33:58.836 3871 5232 D adservices: MeasurementHttpClient::setup : setting unsafe SSL for localhost, URI: https://localhost:8080/source?ad_id=1
11-22 08:33:58.837 3871 5232 D TrafficStats: tagSocket(90) with statsTag=0xffffffff, statsUid=-1
11-22 08:33:58.839 3871 5232 E adservices: Failed to get registration response
11-22 08:33:58.839 3871 5232 E adservices: javax.net.ssl.SSLHandshakeException: connection closed
11-22 08:33:58.839 3871 5232 E adservices: at com.android.org.conscrypt.SSLUtils.toSSLHandshakeException(SSLUtils.java:356)
11-22 08:33:58.839 3871 5232 E adservices: at com.android.org.conscrypt.ConscryptEngineSocket.doHandshake(ConscryptEngineSocket.java:239)
11-22 08:33:58.839 3871 5232 E adservices: at com.android.org.conscrypt.ConscryptEngineSocket.startHandshake(ConscryptEngineSocket.java:218)
11-22 08:33:58.839 3871 5232 E adservices: at com.android.okhttp.internal.io.RealConnection.connectTls(RealConnection.java:196)
11-22 08:33:58.839 3871 5232 E adservices: at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:153)
11-22 08:33:58.839 3871 5232 E adservices: at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:116)
11-22 08:33:58.839 3871 5232 E adservices: at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:186)
11-22 08:33:58.839 3871 5232 E adservices: at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:128)
11-22 08:33:58.839 3871 5232 E adservices: at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
11-22 08:33:58.839 3871 5232 E adservices: at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:289)
11-22 08:33:58.839 3871 5232 E adservices: at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:232)
11-22 08:33:58.839 3871 5232 E adservices: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
11-22 08:33:58.839 3871 5232 E adservices: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:411)
11-22 08:33:58.839 3871 5232 E adservices: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getHeaders(HttpURLConnectionImpl.java:167)
11-22 08:33:58.839 3871 5232 E adservices: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getHeaderFields(HttpURLConnectionImpl.java:227)
11-22 08:33:58.839 3871 5232 E adservices: at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getHeaderFields(DelegatingHttpsURLConnection.java:179)
11-22 08:33:58.839 3871 5232 E adservices: at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getHeaderFields(HttpsURLConnectionImpl.java:30)
11-22 08:33:58.839 3871 5232 E adservices: at com.android.adservices.service.measurement.registration.AsyncSourceFetcher.fetchSource(AsyncSourceFetcher.java:730)
11-22 08:33:58.839 3871 5232 E adservices: at com.android.adservices.service.measurement.registration.AsyncRegistrationQueueRunner.processSourceRegistration(AsyncRegistrationQueueRunner.java:147)
11-22 08:33:58.839 3871 5232 E adservices: at com.android.adservices.service.measurement.registration.AsyncRegistrationQueueRunner.runAsyncRegistrationQueueWorker(AsyncRegistrationQueueRunner.java:133)
11-22 08:33:58.839 3871 5232 E adservices: at com.android.adservices.service.measurement.registration.AsyncRegistrationQueueJobService.lambda$onStartJob$0(AsyncRegistrationQueueJobService.java:76)
11-22 08:33:58.839 3871 5232 E adservices: at com.android.adservices.service.measurement.registration.AsyncRegistrationQueueJobService.$r8$lambda$LxvrB95zsg4TwWvAtnjhjajaYYI(AsyncRegistrationQueueJobService.java:0)
11-22 08:33:58.839 3871 5232 E adservices: at com.android.adservices.service.measurement.registration.AsyncRegistrationQueueJobService$$ExternalSyntheticLambda0.run(R8$$SyntheticClass:0)
11-22 08:33:58.839 3871 5232 E adservices: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
11-22 08:33:58.839 3871 5232 E adservices: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
11-22 08:33:58.839 3871 5232 E adservices: at java.lang.Thread.run(Thread.java:1012)
Is there any plan to support http
protocol for development purposes?
Hi @rkim-branch, unfortunately ARA can not be tested on a local server and there are no current plans to support that. I'm sorry for the inconvenience!
I am using the emulator based on the instructions https://developer.android.com/design-for-safety/privacy-sandbox/program-overview?version=preview
I am trying to run the demo(https://github.com/android/privacy-sandbox-samples/tree/main/AttributionReporting/MeasurementSampleApp on my emulator, and I am running my test trigger and source handling server.
I clicked on the "Register Click Event" button, I did not catch requests and there were no related error logs in Logcat.
I ran
adb shell cmd jobscheduler run -f com.google.android.adservices.api 20
but, nothing was flowing into my locally running serverAfter registration, the API don't issues http requests to the service endpoint to my localhost,Can anyone help me to figure out?