In this paper, we consider optimizing a multiple-input multiple-output (MIMO) dual-functional radar-communication (DFRC) transceiver at the roadside unit (RSU) to detect a potential eavesdropping target and transmit the private information securely to the legitimate vehicular users. An optimization problem is formulated by optimizing the sum secrecy throughput of vehicle-to-infrastructure (V2I) links under requirements of waveform similarity and target return signal-to-interference-plus-noise ratio (SINR) threshold. To handle the challenging issue, we first cast the resulting non-convex problem into an equivalent optimization problem relying on the mean-square error (MSE) technique specified resource budget, and then develop an alternating procedure to decouple two optimization variables and decompose the resulting problem as two subproblems. To deal with the subproblem, we propose a dual ascent approach (DAA) based on the Limited-memory Broyden Fletcher Goldfarb and Shanno (LBFGS). Simulation results confirm the efficiency of the devised optimization method.