Edit: Solved for me
I saw this error message from the shinyapps.io log after deploying my app. The app was working fine locally but having issue accessing the URL via shinyapps.io, throwing error message "SSL peer certificate or SSH remote key was not OK"
The solution that works for me is to change the url from https to http.
Repex (before changing to http) :
library(shiny)
library(jsonlite)
library(httr)
ui <- fluidPage(
actionButton("submit", "Submit"),
dataTableOutput("table")
)
server <- function(input, output, session) {
observeEvent(input$submit, {
url <- "https://publicinfobanjir.water.gov.my/wp-content/themes/enlighten/data/currentalert.json"
h1 <- GET(url=url, verbose(), config(cainfo="cacert.pem"))
h2 <- content(h1, as="text")
df <- fromJSON(h2)
output$table <- renderDataTable({df})
})
}
shinyApp(ui, server)