The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.
Sometimes when using connectapi
, customizing HTTP
requests is desirable. For instance, some common use cases are:
This is possible with connectapi
thanks to the
underlying library in use, httr
.
When you initialize a connectapi
API client, you
implicitly create a httr
HTTP client. The httr
package allows you to configure your HTTP requests globally using
httr::set_config()
or in a scoped variant
httr::with_config
. We will walk through a few examples
below.
library(httr)
library(connectapi)
<- connect()
client
# notice that TLS verification fails
get_users(client)
# use a custom Certificate Authority to verify SSL/TLS requests
::set_config(httr::config(cainfo = "/path/to/my.pem"))
httr
# now it should succeed!
get_users(client)
Sometimes when first setting up a server, it is common to use self-signed certificates. This is generally bad for reliable communication and security (as there is no reason for any computer to trust this server as a “self-declared” trustworthy actor).
However, it can be useful while the organization’s Certificate Authority (CA) is in the process of issuing a valid certificate, or while a certificate is procured from a public CA.
# disabling certificate trust (can allow man-in-the-middle attacks, etc.)
::set_config(httr::config(ssl_verifypeer = 0, ssl_verifyhost = 0))
httr
# should work
<- connect()
client get_users(client)
You can also do this in a more scoped fashion:
::with_config(
httr::config(ssl_verifypeer = 0, ssl_verifyhost = 0),
httr
{<- connect()
client get_users(client)
} )
Suffice it to say that effectively using Kerberos for HTTP is a bit
of an advanced topic. However, it is possible with
httr
.
It is worth noting that today, this interferes with API key authentication, which we are hoping to improve in a future release of Posit Connect.
# disables authentication header that is included by default
$using_auth = FALSE
client
# use Kerberos authentication mechanism (requires local credential cache)
$httr_config(httr::authenticate(":", "", type="gssnegotiate")) client
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.